Tamil
மொழிகள்
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

Parameter

class Parameter(name)[source]

Bases: ParameterExpression

Parameter Class for variable parameters.

A parameter is a variable value that is not required to be fixed at circuit definition.

Examples

Construct a variable-rotation X gate using circuit parameters.

from qiskit.circuit import QuantumCircuit, Parameter

# create the parameter
phi = Parameter('phi')
qc = QuantumCircuit(1)

# parameterize the rotation
qc.rx(phi, 0)
qc.draw('mpl')

# bind the parameters after circuit to create a bound circuit
bc = qc.bind_parameters({phi: 3.14})
bc.measure_all()
bc.draw('mpl')

(Source code)

../_images/qiskit-circuit-Parameter-1_00.png

Fig. 10 (png, hires.png, pdf)

../_images/qiskit-circuit-Parameter-1_01.png

Fig. 11 (png, hires.png, pdf)

Create a new named Parameter.

Parameters

name (str) -- name of the Parameter, used for visual representation. This can be any unicode string, e.g. "ϕ".

Methods

arccos

Arccos of a ParameterExpression

arcsin

Arcsin of a ParameterExpression

arctan

Arctan of a ParameterExpression

assign

Assign one parameter to a value, which can either be numeric or another parameter expression.

bind

Binds the provided set of parameters to their corresponding values.

conjugate

Return the conjugate.

cos

Cosine of a ParameterExpression

exp

Exponential of a ParameterExpression

gradient

Get the derivative of a parameter expression w.r.t.

is_real

Return whether the expression is real

log

Logarithm of a ParameterExpression

sin

Sine of a ParameterExpression

subs

Substitute self with the corresponding parameter in parameter_map.

sympify

Return symbolic expression as a raw Sympy or Symengine object.

tan

Tangent of a ParameterExpression

Attributes

name

Returns the name of the Parameter.

parameters

Returns a set of the unbound Parameters in the expression.

Return type

Set