Skip to content

Commit

Permalink
Wording tweaks
Browse files Browse the repository at this point in the history
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Luciano Bello <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2023
1 parent 1c023bd commit 8f47a64
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions qiskit/circuit/parameterexpression.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def numeric(self) -> int | float | complex:
when they are involved. If you want to assert that all floating-point calculations *were*
carried out at infinite precision (i.e. :class:`float` could represent every intermediate
value exactly), you can use :meth:`float.is_integer` to check if the return float represents
and integer and cast it using :class:`int` if so. This would be an unusual pattern;
an integer and cast it using :class:`int` if so. This would be an unusual pattern;
typically one requires this by only ever using explicitly :class:`~numbers.Rational` objects
while working with symbolic expressions.
Expand All @@ -524,7 +524,7 @@ def numeric(self) -> int | float | complex:
"""
if self._parameter_symbols:
raise TypeError(
f"expression with unbound parameters '{self.parameters}' is not numeric"
f"Expression with unbound parameters '{self.parameters}' is not numeric"
)
if self._symbol_expr.is_integer:
# Integer evaluation is reliable, as far as we know.
Expand Down
2 changes: 1 addition & 1 deletion qiskit/circuit/quantumcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3124,7 +3124,7 @@ def map_calibration(qubits, parameters, schedule):
if not parameter.parameters:
parameter = parameter.numeric()
if isinstance(parameter, complex):
raise TypeError(f"calibration cannot use complex number: '{parameter}'")
raise TypeError(f"Calibration cannot use complex number: '{parameter}'")
new_parameters[i] = parameter
modified = True
if modified:
Expand Down
2 changes: 1 addition & 1 deletion qiskit/transpiler/passes/basis/basis_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def _replace_node(self, dag, node, instr_map):
if not new_phase.parameters:
new_phase = new_phase.numeric()
if isinstance(new_phase, complex):
raise TranspilerError(f"global phase must be real, but got '{new_phase}'")
raise TranspilerError(f"Global phase must be real, but got '{new_phase}'")
bound_target_dag.global_phase = new_phase
else:
bound_target_dag = target_dag
Expand Down

0 comments on commit 8f47a64

Please sign in to comment.