from qiskit import QuantumCircuit, Parameter param = Parameter('θ') qc = QuantumCircuit(1) qc.rx(param, 0) qc.bind_parameters({param: 1.57})
from qiskit import QuantumCircuit, Parameter theta = Parameter('θ') phi = Parameter('ϕ') qc = QuantumCircuit(2) qc.rx(theta, 0) qc.ry(phi, 1) qc.bind_parameters({theta: 1.57, phi: 0.78})This circuit sets two parameters `θ` and `ϕ` to be `1.57` and `0.78`, respectively, and applies an `rx` gate to qubit 0 with `θ` and an `ry` gate to qubit 1 with `ϕ`. In both examples, the `QuantumCircuit.bind_parameters` method is used to substitute the parameters' values into the circuit. This allows for quick and easy parameterization of circuits without having to declare new circuits for each parameter value.