178 lines
4.7 KiB
Plaintext
178 lines
4.7 KiB
Plaintext
---
|
||
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
|
||
---
|
||
|
||
# Parameter
|
||
|
||
<Class id="qiskit.circuit.Parameter" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.19/qiskit/circuit/parameter.py" signature="Parameter(name)" modifiers="class">
|
||
Bases: `qiskit.circuit.parameterexpression.ParameterExpression`
|
||
|
||
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. “ϕ”.
|
||
|
||
## Methods
|
||
|
||
### arccos
|
||
|
||
<Function id="qiskit.circuit.Parameter.arccos" signature="Parameter.arccos()">
|
||
Arccos of a ParameterExpression
|
||
</Function>
|
||
|
||
### arcsin
|
||
|
||
<Function id="qiskit.circuit.Parameter.arcsin" signature="Parameter.arcsin()">
|
||
Arcsin of a ParameterExpression
|
||
</Function>
|
||
|
||
### arctan
|
||
|
||
<Function id="qiskit.circuit.Parameter.arctan" signature="Parameter.arctan()">
|
||
Arctan of a ParameterExpression
|
||
</Function>
|
||
|
||
### assign
|
||
|
||
<Function id="qiskit.circuit.Parameter.assign" signature="Parameter.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`]) – 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="Parameter.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="Parameter.conjugate()">
|
||
Return the conjugate.
|
||
|
||
**Return type**
|
||
|
||
`ParameterExpression`
|
||
</Function>
|
||
|
||
### cos
|
||
|
||
<Function id="qiskit.circuit.Parameter.cos" signature="Parameter.cos()">
|
||
Cosine of a ParameterExpression
|
||
</Function>
|
||
|
||
### exp
|
||
|
||
<Function id="qiskit.circuit.Parameter.exp" signature="Parameter.exp()">
|
||
Exponential of a ParameterExpression
|
||
</Function>
|
||
|
||
### gradient
|
||
|
||
<Function id="qiskit.circuit.Parameter.gradient" signature="Parameter.gradient(param)">
|
||
Get the derivative of a parameter expression w\.r.t. a specified parameter expression.
|
||
|
||
**Parameters**
|
||
|
||
**param** ([*Parameter*](qiskit.circuit.Parameter "qiskit.circuit.Parameter")) – Parameter w\.r.t. which we want to take the derivative
|
||
|
||
**Return type**
|
||
|
||
`Union`\[`ParameterExpression`, `complex`]
|
||
|
||
**Returns**
|
||
|
||
ParameterExpression representing the gradient of param\_expr w\.r.t. param or complex or float number
|
||
</Function>
|
||
|
||
### is\_real
|
||
|
||
<Function id="qiskit.circuit.Parameter.is_real" signature="Parameter.is_real()">
|
||
Return whether the expression is real
|
||
</Function>
|
||
|
||
### log
|
||
|
||
<Function id="qiskit.circuit.Parameter.log" signature="Parameter.log()">
|
||
Logarithm of a ParameterExpression
|
||
</Function>
|
||
|
||
### sin
|
||
|
||
<Function id="qiskit.circuit.Parameter.sin" signature="Parameter.sin()">
|
||
Sine of a ParameterExpression
|
||
</Function>
|
||
|
||
### subs
|
||
|
||
<Function id="qiskit.circuit.Parameter.subs" signature="Parameter.subs(parameter_map)">
|
||
Substitute self with the corresponding parameter in `parameter_map`.
|
||
</Function>
|
||
|
||
### tan
|
||
|
||
<Function id="qiskit.circuit.Parameter.tan" signature="Parameter.tan()">
|
||
Tangent of a ParameterExpression
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### 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>
|
||
</Class>
|
||
|