qiskit-documentation/docs/api/qiskit/0.24/qiskit.circuit.Parameter.mdx

129 lines
5.3 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Parameter
description: API reference for qiskit.circuit.Parameter
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.circuit.Parameter
---
<span id="qiskit-circuit-parameter" />
# qiskit.circuit.Parameter
<Class id="qiskit.circuit.Parameter" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.16/qiskit/circuit/parameter.py" signature="Parameter(name)" modifiers="class">
Parameter Class for variable parameters.
Create a new named [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter").
**Parameters**
**name** (`str`) name of the `Parameter`, used for visual representation. This can be any unicode string, e.g. “ϕ”.
### \_\_init\_\_
<Function id="qiskit.circuit.Parameter.__init__" signature="__init__(name)">
Create a new named [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter").
**Parameters**
**name** (`str`) name of the `Parameter`, used for visual representation. This can be any unicode string, e.g. “ϕ”.
</Function>
## Methods
| | |
| ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
| [`__init__`](#qiskit.circuit.Parameter.__init__ "qiskit.circuit.Parameter.__init__")(name) | Create a new named [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter"). |
| [`assign`](#qiskit.circuit.Parameter.assign "qiskit.circuit.Parameter.assign")(parameter, value) | Assign one parameter to a value, which can either be numeric or another parameter expression. |
| [`bind`](#qiskit.circuit.Parameter.bind "qiskit.circuit.Parameter.bind")(parameter\_values) | Binds the provided set of parameters to their corresponding values. |
| [`conjugate`](#qiskit.circuit.Parameter.conjugate "qiskit.circuit.Parameter.conjugate")() | Return the conjugate, which is the ParameterExpression itself, since it is real. |
| [`subs`](#qiskit.circuit.Parameter.subs "qiskit.circuit.Parameter.subs")(parameter\_map) | Substitute self with the corresponding parameter in `parameter_map`. |
## Attributes
| | |
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| [`name`](#qiskit.circuit.Parameter.name "qiskit.circuit.Parameter.name") | Returns the name of the [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter"). |
| [`parameters`](#qiskit.circuit.Parameter.parameters "qiskit.circuit.Parameter.parameters") | Returns a set of the unbound Parameters in the expression. |
### assign
<Function id="qiskit.circuit.Parameter.assign" signature="assign(parameter, value)">
Assign one parameter to a value, which can either be numeric or another parameter expression.
**Parameters**
* **parameter** ([*Parameter*](#qiskit.circuit.Parameter "qiskit.circuit.Parameter")) A parameter in this expression whose value will be updated.
* **value** (`Union`\[`ParameterExpression`, `float`, `int`]) The new value to bind to.
**Return type**
`ParameterExpression`
**Returns**
A new expression parameterized by any parameters which were not bound by assignment.
</Function>
### bind
<Function id="qiskit.circuit.Parameter.bind" signature="bind(parameter_values)">
Binds the provided set of parameters to their corresponding values.
**Parameters**
**parameter\_values** (`Dict`) Mapping of Parameter instances to the numeric value to which they will be bound.
**Raises**
* **CircuitError**
* If parameter\_values contains Parameters outside those in self. - If a non-numeric value is passed in parameter\_values.
* **ZeroDivisionError**
* If binding the provided values requires division by zero.
**Return type**
`ParameterExpression`
**Returns**
A new expression parameterized by any parameters which were not bound by parameter\_values.
</Function>
### conjugate
<Function id="qiskit.circuit.Parameter.conjugate" signature="conjugate()">
Return the conjugate, which is the ParameterExpression itself, since it is real.
**Return type**
`ParameterExpression`
</Function>
### name
<Attribute id="qiskit.circuit.Parameter.name">
Returns the name of the [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter").
</Attribute>
### parameters
<Attribute id="qiskit.circuit.Parameter.parameters">
Returns a set of the unbound Parameters in the expression.
**Return type**
`Set`
</Attribute>
### subs
<Function id="qiskit.circuit.Parameter.subs" signature="subs(parameter_map)">
Substitute self with the corresponding parameter in `parameter_map`.
</Function>
</Class>