Skip to content

Commit

Permalink
Update qiskit/circuit/parametertable.py
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Gacon <[email protected]>
  • Loading branch information
jakelishman and Cryoris authored Jan 5, 2024
1 parent da5038a commit e7e2489
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions qiskit/circuit/parametertable.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,14 @@ def get_names(self):
return self._names.keys()

def parameter_from_name(self, name: str, default: typing.Any = None):
"""Get a :class:`.Parameter` with references in this table by its string name, or return the
default if not present.
"""Get a :class:`.Parameter` with references in this table by its string name.
If the parameter is not present, return the ``default`` value.
Args:
name: the name of the :class:`.Parameter`
default: the object that should be returned if the parameter is missing."""
name: The name of the :class:`.Parameter`
default: The object that should be returned if the parameter is missing.
"""
return self._names.get(name, default)

def discard_references(self, expression, key):
Expand Down

0 comments on commit e7e2489

Please sign in to comment.