forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
QuantumCircuit.get_parameter
to retrieve by name
This allows `Parameter` instances to be retrieved from a circuit by string name. The interface is a mirror of the same functionality already added for run-time variables (`get_var`), but for the compile-time `Parameter` class. Similarly, a `has_parameter` method mirrors `has_var`.
- Loading branch information
1 parent
70901b2
commit da5038a
Showing
4 changed files
with
165 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/circuit-get-parameter-d33c08925b5c7d72.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
features: | ||
- | | ||
:class:`.QuantumCircuit` has two new methods, :meth:`~.QuantumCircuit.get_parameter` and | ||
:meth:`~.QuantumCircuit.has_parameter`, which respectively retrieve a :class:`.Parameter` | ||
instance used in the circuit by name, and return a Boolean of whether a parameter with a | ||
matching name (or the exact instance given) are used in the circuit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters