---
title: Parameter (v1.1)
description: API reference for qiskit.circuit.Parameter in qiskit v1.1
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/1.1/qiskit.circuit.Parameter
---

# Parameter

*class* `qiskit.circuit.Parameter(name, *, uuid=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameter.py#L27-L175)

Bases: [`ParameterExpression`](/docs/api/qiskit/1.1/qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression")

A compile-time symbolic parameter.

The value of a [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter") must be entirely determined before a circuit begins execution. Typically this will mean that you should supply values for all [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter")s in a circuit using [`QuantumCircuit.assign_parameters()`](/docs/api/qiskit/1.1/qiskit.circuit.QuantumCircuit#assign_parameters "qiskit.circuit.QuantumCircuit.assign_parameters"), though certain hardware vendors may allow you to give them a circuit in terms of these parameters, provided you also pass the values separately.

This is the atom of [`ParameterExpression`](/docs/api/qiskit/1.1/qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression"), and is itself an expression. The numeric value of a parameter need not be fixed while the circuit is being defined.

**Examples**

Construct a variable-rotation X gate using circuit parameters.

```python
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.assign_parameters({phi: 3.14})
bc.measure_all()
bc.draw('mpl')
```

![../\_images/qiskit-circuit-Parameter-1\_00.png](https://eu-de.quantum.cloud.ibm.com/docs/images/api/qiskit/1.1/qiskit-circuit-Parameter-1_00.avif)

![../\_images/qiskit-circuit-Parameter-1\_01.png](https://eu-de.quantum.cloud.ibm.com/docs/images/api/qiskit/1.1/qiskit-circuit-Parameter-1_01.avif)

**Parameters**

- **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – name of the `Parameter`, used for visual representation. This can be any Unicode string, e.g. “ϕ”.
- **uuid** (*UUID | None*) – For advanced usage only. Override the UUID of this parameter, in order to make it compare equal to some other parameter object. By default, two parameters with the same name do not compare equal to help catch shadowing bugs when two circuits containing the same named parameters are spurious combined. Setting the `uuid` field when creating two parameters to the same thing (along with the same name) allows them to be equal. This is useful during serialization and deserialization.

## Attributes

### name

Returns the name of the [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter").

### parameters

Returns a set of the unbound Parameters in the expression.

### uuid

Returns the [`UUID`](https://docs.python.org/3/library/uuid.html#uuid.UUID) of the [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter").

In advanced use cases, this property can be passed to the [`Parameter`](#qiskit.circuit.Parameter "qiskit.circuit.Parameter") constructor to produce an instance that compares equal to another instance.

## Methods

### abs

`abs()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L457-L459)

Absolute of a ParameterExpression

### arccos

`arccos()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L369-L371)

Arccos of a ParameterExpression

### arcsin

`arcsin()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L365-L367)

Arcsin of a ParameterExpression

### arctan

`arctan()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L373-L375)

Arctan of a ParameterExpression

### assign

`assign(parameter, value)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameter.py#L92-L104)

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** – The new value to bind to.

**Returns**

A new expression parameterized by any parameters which were not bound by assignment.

### bind

`bind(parameter_values, allow_unknown_parameters=False)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L93-L146)

Binds the provided set of parameters to their corresponding values.

**Parameters**

- **parameter\_values** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)) – Mapping of Parameter instances to the numeric value to which they will be bound.
- **allow\_unknown\_parameters** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – If `False`, raises an error if `parameter_values` contains Parameters in the keys outside those present in the expression. If `True`, any such parameters are simply ignored.

**Raises**

- [**CircuitError**](/docs/api/qiskit/1.1/circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") –

  - If parameter\_values contains Parameters outside those in self. - If a non-numeric value is passed in parameter\_values.

- [**ZeroDivisionError**](https://docs.python.org/3/library/exceptions.html#ZeroDivisionError) –

  - If binding the provided values requires division by zero.

**Returns**

A new expression parameterized by any parameters which were not bound by parameter\_values.

**Return type**

[*ParameterExpression*](/docs/api/qiskit/1.1/qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression")

### conjugate

`conjugate()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L70-L75)

Return the conjugate.

**Return type**

[*ParameterExpression*](/docs/api/qiskit/1.1/qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression")

### cos

`cos()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L357-L359)

Cosine of a ParameterExpression

### exp

`exp()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L377-L379)

Exponential of a ParameterExpression

### gradient

`gradient(param)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L279-L313)

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

**Returns**

ParameterExpression representing the gradient of param\_expr w\.r.t. param or complex or float number

**Return type**

[*ParameterExpression*](/docs/api/qiskit/1.1/qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") | [complex](https://docs.python.org/3/library/functions.html#complex)

### is\_real

`is_real()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L480-L491)

Return whether the expression is real

### log

`log()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L381-L383)

Logarithm of a ParameterExpression

### numeric

`numeric()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L493-L537)

Return a Python number representing this object, using the most restrictive of [`int`](https://docs.python.org/3/library/functions.html#int), [`float`](https://docs.python.org/3/library/functions.html#float) and [`complex`](https://docs.python.org/3/library/functions.html#complex) that is valid for this object.

In general, an [`int`](https://docs.python.org/3/library/functions.html#int) is only returned if the expression only involved symbolic integers. If floating-point values were used during the evaluation, the return value will be a [`float`](https://docs.python.org/3/library/functions.html#float) regardless of whether the represented value is an integer. This is because floating-point values “infect” symbolic computations by their inexact nature, and symbolic libraries will use inexact floating-point semantics not exact real-number semantics when they are involved. If you want to assert that all floating-point calculations *were* carried out at infinite precision (i.e. [`float`](https://docs.python.org/3/library/functions.html#float) could represent every intermediate value exactly), you can use [`float.is_integer()`](https://docs.python.org/3/library/stdtypes.html#float.is_integer) to check if the return float represents an integer and cast it using [`int`](https://docs.python.org/3/library/functions.html#int) if so. This would be an unusual pattern; typically one requires this by only ever using explicitly [`Rational`](https://docs.python.org/3/library/numbers.html#numbers.Rational) objects while working with symbolic expressions.

This is more reliable and performant than using [`is_real()`](#qiskit.circuit.Parameter.is_real "qiskit.circuit.Parameter.is_real") followed by calling [`float`](https://docs.python.org/3/library/functions.html#float) or [`complex`](https://docs.python.org/3/library/functions.html#complex), as in some cases [`is_real()`](#qiskit.circuit.Parameter.is_real "qiskit.circuit.Parameter.is_real") needs to force a floating-point evaluation to determine an accurate result to work around bugs in the upstream symbolic libraries.

**Returns**

A Python number representing the object.

**Raises**

[**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError) – if there are unbound parameters.

**Return type**

[int](https://docs.python.org/3/library/functions.html#int) | [float](https://docs.python.org/3/library/functions.html#float) | [complex](https://docs.python.org/3/library/functions.html#complex)

### sign

`sign()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L385-L387)

Sign of a ParameterExpression

### sin

`sin()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L353-L355)

Sine of a ParameterExpression

### subs

`subs(parameter_map, allow_unknown_parameters=False)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameter.py#L106-L115)

Substitute self with the corresponding parameter in `parameter_map`.

### sympify

`sympify()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L539-L551)

Return symbolic expression as a raw Sympy or Symengine object.

Symengine is used preferentially; if both are available, the result will always be a `symengine` object. Symengine is a separate library but has integration with Sympy.

> **Note**
>
> This is for interoperability only. Qiskit will not accept or work with raw Sympy or Symegine expressions in its parameters, because they do not contain the tracking information used in circuit-parameter binding and assignment.

### tan

`tan()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/circuit/parameterexpression.py#L361-L363)

Tangent of a ParameterExpression
