mirror of https://github.com/Qiskit/qiskit.git
Spellcheck Done [Unitary Hack 2024] (#12501)
* spell check iter1 * spell check iter 2 * Fix fmt * Update qiskit/_numpy_compat.py * Update qiskit/synthesis/evolution/product_formula.py * Update qiskit/synthesis/evolution/product_formula.py * Update releasenotes/notes/0.13/qinfo-states-7f67e2432cf0c12c.yaml * undo some corrections --------- Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> Co-authored-by: Luciano Bello <bel@zurich.ibm.com> Co-authored-by: Julien Gacon <jules.gacon@googlemail.com>
This commit is contained in:
parent
53667d167e
commit
0f513577b3
|
@ -7,7 +7,7 @@
|
|||
# - pylatexenc: for MPL drawer
|
||||
# - pillow: for image comparison
|
||||
# - appmode: jupyter extension for executing the notebook
|
||||
# - seaborn: visualisation pacakge required for some graphs
|
||||
# - seaborn: visualization pacakge required for some graphs
|
||||
pip install matplotlib pylatexenc pillow appmode seaborn
|
||||
pip install .
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: Backport metadata
|
||||
|
||||
# Mergify manages the opening of the backport PR, this workflow is just to extend its behaviour to
|
||||
# Mergify manages the opening of the backport PR, this workflow is just to extend its behavior to
|
||||
# do useful things like copying across the tagged labels and milestone from the base PR.
|
||||
|
||||
on:
|
||||
|
|
|
@ -532,7 +532,7 @@ we used in our CI systems more closely.
|
|||
|
||||
### Snapshot Testing for Visualizations
|
||||
|
||||
If you are working on code that makes changes to any matplotlib visualisations
|
||||
If you are working on code that makes changes to any matplotlib visualizations
|
||||
you will need to check that your changes don't break any snapshot tests, and add
|
||||
new tests where necessary. You can do this as follows:
|
||||
|
||||
|
@ -543,7 +543,7 @@ the snapshot tests (note this may take some time to finish loading).
|
|||
3. Each test result provides a set of 3 images (left: reference image, middle: your test result, right: differences). In the list of tests the passed tests are collapsed and failed tests are expanded. If a test fails, you will see a situation like this:
|
||||
|
||||
<img width="995" alt="Screenshot_2021-03-26_at_14 13 54" src="https://user-images.githubusercontent.com/23662430/112663508-d363e800-8e50-11eb-9478-6d665d0ff086.png">
|
||||
4. Fix any broken tests. Working on code for one aspect of the visualisations
|
||||
4. Fix any broken tests. Working on code for one aspect of the visualizations
|
||||
can sometimes result in minor changes elsewhere to spacing etc. In these cases
|
||||
you just need to update the reference images as follows:
|
||||
- download the mismatched images (link at top of Jupyter Notebook output)
|
||||
|
|
|
@ -29,11 +29,11 @@ This would be a particular problem for defining the circuit object and using it
|
|||
|
||||
## Developer notes
|
||||
|
||||
### Beware of initialisation order
|
||||
### Beware of initialization order
|
||||
|
||||
The Qiskit C extension `qiskit._accelerate` needs to be initialised in a single go.
|
||||
It is the lowest part of the Python package stack, so it cannot rely on importing other parts of the Python library at initialisation time (except for exceptions through PyO3's `import_exception!` mechanism).
|
||||
This is because, unlike pure-Python modules, the initialisation of `_accelerate` cannot be done partially, and many components of Qiskit import their accelerators from `_accelerate`.
|
||||
The Qiskit C extension `qiskit._accelerate` needs to be initialized in a single go.
|
||||
It is the lowest part of the Python package stack, so it cannot rely on importing other parts of the Python library at initialization time (except for exceptions through PyO3's `import_exception!` mechanism).
|
||||
This is because, unlike pure-Python modules, the initialization of `_accelerate` cannot be done partially, and many components of Qiskit import their accelerators from `_accelerate`.
|
||||
|
||||
In general, this should not be too onerous a requirement, but if you violate it, you might see Rust panics on import, and PyO3 should wrap that up into an exception.
|
||||
You might be able to track down the Rust source of the import cycle by running the import with the environment variable `RUST_BACKTRACE=full`.
|
||||
|
|
|
@ -32,7 +32,7 @@ pub fn fast_sum_with_simd<S: Simd>(simd: S, values: &[f64]) -> f64 {
|
|||
sum + tail.iter().sum::<f64>()
|
||||
}
|
||||
|
||||
/// Compute the pauli expectatation value of a statevector without x
|
||||
/// Compute the pauli expectation value of a statevector without x
|
||||
#[pyfunction]
|
||||
#[pyo3(text_signature = "(data, num_qubits, z_mask, /)")]
|
||||
pub fn expval_pauli_no_x(
|
||||
|
@ -63,7 +63,7 @@ pub fn expval_pauli_no_x(
|
|||
}
|
||||
}
|
||||
|
||||
/// Compute the pauli expectatation value of a statevector with x
|
||||
/// Compute the pauli expectation value of a statevector with x
|
||||
#[pyfunction]
|
||||
#[pyo3(text_signature = "(data, num_qubits, z_mask, x_mask, phase, x_max, /)")]
|
||||
pub fn expval_pauli_with_x(
|
||||
|
@ -121,7 +121,7 @@ pub fn expval_pauli_with_x(
|
|||
}
|
||||
}
|
||||
|
||||
/// Compute the pauli expectatation value of a density matrix without x
|
||||
/// Compute the pauli expectation value of a density matrix without x
|
||||
#[pyfunction]
|
||||
#[pyo3(text_signature = "(data, num_qubits, z_mask, /)")]
|
||||
pub fn density_expval_pauli_no_x(
|
||||
|
@ -153,7 +153,7 @@ pub fn density_expval_pauli_no_x(
|
|||
}
|
||||
}
|
||||
|
||||
/// Compute the pauli expectatation value of a density matrix with x
|
||||
/// Compute the pauli expectation value of a density matrix with x
|
||||
#[pyfunction]
|
||||
#[pyo3(text_signature = "(data, num_qubits, z_mask, x_mask, phase, x_max, /)")]
|
||||
pub fn density_expval_pauli_with_x(
|
||||
|
|
|
@ -27,7 +27,7 @@ pub struct DAGNode {
|
|||
}
|
||||
|
||||
/// A DAG representation of the logical circuit to be routed. This represents the same dataflow
|
||||
/// dependences as the Python-space [DAGCircuit], but without any information about _what_ the
|
||||
/// dependencies as the Python-space [DAGCircuit], but without any information about _what_ the
|
||||
/// operations being performed are. Note that all the qubit references here are to "virtual"
|
||||
/// qubits, that is, the qubits are those specified by the user. This DAG does not need to be
|
||||
/// full-width on the hardware.
|
||||
|
|
|
@ -421,7 +421,7 @@ fn decompose_dense_inner(
|
|||
) {
|
||||
if num_qubits == 0 {
|
||||
// It would be safe to `return` here, but if it's unreachable then LLVM is allowed to
|
||||
// optimise out this branch entirely in release mode, which is good for a ~2% speedup.
|
||||
// optimize out this branch entirely in release mode, which is good for a ~2% speedup.
|
||||
unreachable!("should not call this with an empty operator")
|
||||
}
|
||||
// Base recursion case.
|
||||
|
@ -529,7 +529,7 @@ fn to_matrix_dense_inner(paulis: &MatrixCompressedPaulis, parallel: bool) -> Vec
|
|||
out
|
||||
};
|
||||
let write_row = |(i_row, row): (usize, &mut [Complex64])| {
|
||||
// Doing the initialisation here means that when we're in parallel contexts, we do the
|
||||
// Doing the initialization here means that when we're in parallel contexts, we do the
|
||||
// zeroing across the whole threadpool. This also seems to give a speed-up in serial
|
||||
// contexts, but I don't understand that. ---Jake
|
||||
row.fill(Complex64::new(0.0, 0.0));
|
||||
|
@ -721,7 +721,7 @@ macro_rules! impl_to_matrix_sparse {
|
|||
|
||||
// The parallel overhead from splitting a subtask is fairly high (allocating and
|
||||
// potentially growing a couple of vecs), so we're trading off some of Rayon's ability
|
||||
// to keep threads busy by subdivision with minimising overhead; we're setting the
|
||||
// to keep threads busy by subdivision with minimizing overhead; we're setting the
|
||||
// chunk size such that the iterator will have as many elements as there are threads.
|
||||
let num_threads = rayon::current_num_threads();
|
||||
let chunk_size = (side + num_threads - 1) / num_threads;
|
||||
|
@ -738,7 +738,7 @@ macro_rules! impl_to_matrix_sparse {
|
|||
// Since we compressed the Paulis by summing equal elements, we're
|
||||
// lower-bounded on the number of elements per row by this value, up to
|
||||
// cancellations. This should be a reasonable trade-off between sometimes
|
||||
// expandin the vector and overallocation.
|
||||
// expanding the vector and overallocation.
|
||||
let mut values =
|
||||
Vec::<Complex64>::with_capacity(chunk_size * (num_ops + 1) / 2);
|
||||
let mut indices = Vec::<$int_ty>::with_capacity(chunk_size * (num_ops + 1) / 2);
|
||||
|
|
|
@ -293,7 +293,7 @@ fn __num_basis_gates(basis_b: f64, basis_fidelity: f64, unitary: MatRef<c64>) ->
|
|||
c64::new(4.0 * c.cos(), 0.0),
|
||||
c64::new(4.0, 0.0),
|
||||
];
|
||||
// The originial Python had `np.argmax`, which returns the lowest index in case two or more
|
||||
// The original Python had `np.argmax`, which returns the lowest index in case two or more
|
||||
// values have a common maximum value.
|
||||
// `max_by` and `min_by` return the highest and lowest indices respectively, in case of ties.
|
||||
// So to reproduce `np.argmax`, we use `min_by` and switch the order of the
|
||||
|
@ -587,7 +587,7 @@ impl TwoQubitWeylDecomposition {
|
|||
// M2 is a symmetric complex matrix. We need to decompose it as M2 = P D P^T where
|
||||
// P ∈ SO(4), D is diagonal with unit-magnitude elements.
|
||||
//
|
||||
// We can't use raw `eig` directly because it isn't guaranteed to give us real or othogonal
|
||||
// We can't use raw `eig` directly because it isn't guaranteed to give us real or orthogonal
|
||||
// eigenvectors. Instead, since `M2` is complex-symmetric,
|
||||
// M2 = A + iB
|
||||
// for real-symmetric `A` and `B`, and as
|
||||
|
|
|
@ -104,7 +104,7 @@ impl From<TokenType> for Op {
|
|||
}
|
||||
}
|
||||
|
||||
/// An atom of the operator-precendence expression parsing. This is a stripped-down version of the
|
||||
/// An atom of the operator-precedence expression parsing. This is a stripped-down version of the
|
||||
/// [Token] and [TokenType] used in the main parser. We can use a data enum here because we do not
|
||||
/// need all the expressive flexibility in expecting and accepting many different token types as
|
||||
/// we do in the main parser; it does not significantly harm legibility to simply do
|
||||
|
@ -233,7 +233,7 @@ fn binary_power(op: Op) -> (u8, u8) {
|
|||
/// A subparser used to do the operator-precedence part of the parsing for individual parameter
|
||||
/// expressions. The main parser creates a new instance of this struct for each expression it
|
||||
/// expects, and the instance lives only as long as is required to parse that expression, because
|
||||
/// it takes temporary resposibility for the [TokenStream] that backs the main parser.
|
||||
/// it takes temporary responsibility for the [TokenStream] that backs the main parser.
|
||||
pub struct ExprParser<'a> {
|
||||
pub tokens: &'a mut Vec<TokenStream>,
|
||||
pub context: &'a mut TokenContext,
|
||||
|
@ -504,7 +504,7 @@ impl<'a> ExprParser<'a> {
|
|||
// This deliberately parses an _integer_ token as a float, since all OpenQASM 2.0
|
||||
// integers can be interpreted as floats, and doing that allows us to gracefully handle
|
||||
// cases where a huge float would overflow a `usize`. Never mind that in such a case,
|
||||
// there's almost certainly precision loss from the floating-point representating
|
||||
// there's almost certainly precision loss from the floating-point representing
|
||||
// having insufficient mantissa digits to faithfully represent the angle mod 2pi;
|
||||
// that's not our fault in the parser.
|
||||
TokenType::Real | TokenType::Integer => Ok(Some(Atom::Const(token.real(self.context)))),
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
//! keyword; the spec technically says that any real number is valid, but in reality that leads to
|
||||
//! weirdness like `200.0e-2` being a valid version specifier. We do things with a custom
|
||||
//! context-dependent match after seeing an `OPENQASM` token, to avoid clashes with the general
|
||||
//! real-number tokenisation.
|
||||
//! real-number tokenization.
|
||||
|
||||
use hashbrown::HashMap;
|
||||
use pyo3::prelude::PyResult;
|
||||
|
@ -30,7 +30,7 @@ use std::path::Path;
|
|||
|
||||
use crate::error::{message_generic, Position, QASM2ParseError};
|
||||
|
||||
/// Tokenised version information data. This is more structured than the real number suggested by
|
||||
/// Tokenized version information data. This is more structured than the real number suggested by
|
||||
/// the specification.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Version {
|
||||
|
@ -353,7 +353,7 @@ impl TokenStream {
|
|||
line_buffer: Vec::with_capacity(80),
|
||||
done: false,
|
||||
// The first line is numbered "1", and the first column is "0". The counts are
|
||||
// initialised like this so the first call to `next_byte` can easily detect that it
|
||||
// initialized like this so the first call to `next_byte` can easily detect that it
|
||||
// needs to extract the next line.
|
||||
line: 0,
|
||||
col: 0,
|
||||
|
|
|
@ -1630,7 +1630,7 @@ impl State {
|
|||
|
||||
/// Update the parser state with the definition of a particular gate. This does not emit any
|
||||
/// bytecode because not all gate definitions need something passing to Python. For example,
|
||||
/// the Python parser initialises its state including the built-in gates `U` and `CX`, and
|
||||
/// the Python parser initializes its state including the built-in gates `U` and `CX`, and
|
||||
/// handles the `qelib1.inc` include specially as well.
|
||||
fn define_gate(
|
||||
&mut self,
|
||||
|
|
|
@ -69,7 +69,7 @@ impl BuilderState {
|
|||
Err(QASM3ImporterError::new_err("cannot handle consts"))
|
||||
} else if decl.initializer().is_some() {
|
||||
Err(QASM3ImporterError::new_err(
|
||||
"cannot handle initialised bits",
|
||||
"cannot handle initialized bits",
|
||||
))
|
||||
} else {
|
||||
self.add_clbit(py, name_id.clone())
|
||||
|
@ -80,7 +80,7 @@ impl BuilderState {
|
|||
Err(QASM3ImporterError::new_err("cannot handle consts"))
|
||||
} else if decl.initializer().is_some() {
|
||||
Err(QASM3ImporterError::new_err(
|
||||
"cannot handle initialised registers",
|
||||
"cannot handle initialized registers",
|
||||
))
|
||||
} else {
|
||||
match dims {
|
||||
|
|
|
@ -281,7 +281,7 @@ impl PyCircuitModule {
|
|||
/// Circuit construction context object to provide an easier Rust-space interface for us to
|
||||
/// construct the Python :class:`.QuantumCircuit`. The idea of doing this from Rust space like
|
||||
/// this is that we might steadily be able to move more and more of it into being native Rust as
|
||||
/// the Rust-space APIs around the internal circuit data stabilise.
|
||||
/// the Rust-space APIs around the internal circuit data stabilize.
|
||||
pub struct PyCircuit(Py<PyAny>);
|
||||
|
||||
impl PyCircuit {
|
||||
|
|
|
@ -71,7 +71,7 @@ fn eval_const_int(_py: Python, _ast_symbols: &SymbolTable, expr: &asg::TExpr) ->
|
|||
match expr.expression() {
|
||||
asg::Expr::Literal(asg::Literal::Int(lit)) => Ok(*lit.value() as isize),
|
||||
expr => Err(QASM3ImporterError::new_err(format!(
|
||||
"unhandled expression type for constant-integer evaluatation: {:?}",
|
||||
"unhandled expression type for constant-integer evaluation: {:?}",
|
||||
expr
|
||||
))),
|
||||
}
|
||||
|
|
|
@ -114,9 +114,9 @@ autoclass_content = "both"
|
|||
autosummary_generate = True
|
||||
autosummary_generate_overwrite = False
|
||||
|
||||
# The pulse library contains some names that differ only in capitalisation, during the changeover
|
||||
# The pulse library contains some names that differ only in capitalization, during the changeover
|
||||
# surrounding SymbolPulse. Since these resolve to autosummary filenames that also differ only in
|
||||
# capitalisation, this causes problems when the documentation is built on an OS/filesystem that is
|
||||
# capitalization, this causes problems when the documentation is built on an OS/filesystem that is
|
||||
# enforcing case-insensitive semantics. This setting defines some custom names to prevent the clash
|
||||
# from happening.
|
||||
autosummary_filename_map = {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# copyright notice, and modified files need to carry a notice indicating
|
||||
# that they have been altered from the originals.
|
||||
|
||||
"""Compatiblity helpers for the Numpy 1.x to 2.0 transition."""
|
||||
"""Compatibility helpers for the Numpy 1.x to 2.0 transition."""
|
||||
|
||||
import re
|
||||
import typing
|
||||
|
|
|
@ -270,7 +270,7 @@ circuit. The top-level ones are:
|
|||
* :class:`ContinueLoopOp`, to move immediately to the next iteration of the containing loop
|
||||
* :class:`ForLoopOp`, to loop over a fixed range of values
|
||||
* :class:`IfElseOp`, to conditionally enter one of two subcircuits
|
||||
* :class:`SwitchCaseOp`, to conditionally enter one of many subcicuits
|
||||
* :class:`SwitchCaseOp`, to conditionally enter one of many subcircuits
|
||||
* :class:`WhileLoopOp`, to repeat a subcircuit until a condition is falsified.
|
||||
|
||||
:ref:`Circuits can include classical expressions that are evaluated in real time
|
||||
|
|
|
@ -31,7 +31,7 @@ class VariableMapper(expr.ExprVisitor[expr.Expr]):
|
|||
call its :meth:`map_condition`, :meth:`map_target` or :meth:`map_expr` methods as appropriate,
|
||||
which will return the new object that should be used.
|
||||
|
||||
If an ``add_register`` callable is given to the initialiser, the mapper will use it to attempt
|
||||
If an ``add_register`` callable is given to the initializer, the mapper will use it to attempt
|
||||
to add new aliasing registers to the outer circuit object, if there is not already a suitable
|
||||
register for the mapping available in the circuit. If this parameter is not given, a
|
||||
``ValueError`` will be raised instead. The given ``add_register`` callable may choose to raise
|
||||
|
@ -73,12 +73,12 @@ class VariableMapper(expr.ExprVisitor[expr.Expr]):
|
|||
|
||||
def map_condition(self, condition, /, *, allow_reorder=False):
|
||||
"""Map the given ``condition`` so that it only references variables in the destination
|
||||
circuit (as given to this class on initialisation).
|
||||
circuit (as given to this class on initialization).
|
||||
|
||||
If ``allow_reorder`` is ``True``, then when a legacy condition (the two-tuple form) is made
|
||||
on a register that has a counterpart in the destination with all the same (mapped) bits but
|
||||
in a different order, then that register will be used and the value suitably modified to
|
||||
make the equality condition work. This is maintaining legacy (tested) behaviour of
|
||||
make the equality condition work. This is maintaining legacy (tested) behavior of
|
||||
:meth:`.DAGCircuit.compose`; nowhere else does this, and in general this would require *far*
|
||||
more complex classical rewriting than Terra needs to worry about in the full expression era.
|
||||
"""
|
||||
|
@ -91,7 +91,7 @@ class VariableMapper(expr.ExprVisitor[expr.Expr]):
|
|||
return (self.bit_map[target], value)
|
||||
if not allow_reorder:
|
||||
return (self._map_register(target), value)
|
||||
# This is maintaining the legacy behaviour of `DAGCircuit.compose`. We don't attempt to
|
||||
# This is maintaining the legacy behavior of `DAGCircuit.compose`. We don't attempt to
|
||||
# speed-up this lookup with a cache, since that would just make the more standard cases more
|
||||
# annoying to deal with.
|
||||
mapped_bits_order = [self.bit_map[bit] for bit in target]
|
||||
|
@ -114,7 +114,7 @@ class VariableMapper(expr.ExprVisitor[expr.Expr]):
|
|||
|
||||
def map_target(self, target, /):
|
||||
"""Map the real-time variables in a ``target`` of a :class:`.SwitchCaseOp` to the new
|
||||
circuit, as defined in the ``circuit`` argument of the initialiser of this class."""
|
||||
circuit, as defined in the ``circuit`` argument of the initializer of this class."""
|
||||
if isinstance(target, Clbit):
|
||||
return self.bit_map[target]
|
||||
if isinstance(target, ClassicalRegister):
|
||||
|
|
|
@ -53,7 +53,7 @@ class Expr(abc.ABC):
|
|||
expressions, and it does not make sense to add more outside of Qiskit library code.
|
||||
|
||||
All subclasses are responsible for setting their ``type`` attribute in their ``__init__``, and
|
||||
should not call the parent initialiser."""
|
||||
should not call the parent initializer."""
|
||||
|
||||
__slots__ = ("type",)
|
||||
|
||||
|
@ -193,7 +193,7 @@ class Var(Expr):
|
|||
return self
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
# ... as are all my consituent parts.
|
||||
# ... as are all my constituent parts.
|
||||
return self
|
||||
|
||||
|
||||
|
@ -241,7 +241,7 @@ class Unary(Expr):
|
|||
|
||||
# If adding opcodes, remember to add helper constructor functions in `constructors.py`.
|
||||
# The opcode integers should be considered a public interface; they are used by
|
||||
# serialisation formats that may transfer data between different versions of Qiskit.
|
||||
# serialization formats that may transfer data between different versions of Qiskit.
|
||||
BIT_NOT = 1
|
||||
"""Bitwise negation. ``~operand``."""
|
||||
LOGIC_NOT = 2
|
||||
|
@ -309,7 +309,7 @@ class Binary(Expr):
|
|||
|
||||
# If adding opcodes, remember to add helper constructor functions in `constructors.py`
|
||||
# The opcode integers should be considered a public interface; they are used by
|
||||
# serialisation formats that may transfer data between different versions of Qiskit.
|
||||
# serialization formats that may transfer data between different versions of Qiskit.
|
||||
BIT_AND = 1
|
||||
"""Bitwise "and". ``lhs & rhs``."""
|
||||
BIT_OR = 2
|
||||
|
|
|
@ -29,7 +29,7 @@ _T_co = typing.TypeVar("_T_co", covariant=True)
|
|||
|
||||
class ExprVisitor(typing.Generic[_T_co]):
|
||||
"""Base class for visitors to the :class:`Expr` tree. Subclasses should override whichever of
|
||||
the ``visit_*`` methods that they are able to handle, and should be organised such that
|
||||
the ``visit_*`` methods that they are able to handle, and should be organized such that
|
||||
non-existent methods will never be called."""
|
||||
|
||||
# The method names are self-explanatory and docstrings would just be noise.
|
||||
|
|
|
@ -40,7 +40,7 @@ literals ``True`` and ``False``), and unsigned integers (corresponding to
|
|||
.. autoclass:: Bool
|
||||
.. autoclass:: Uint
|
||||
|
||||
Note that :class:`Uint` defines a family of types parametrised by their width; it is not one single
|
||||
Note that :class:`Uint` defines a family of types parametrized by their width; it is not one single
|
||||
type, which may be slightly different to the 'classical' programming languages you are used to.
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import typing
|
|||
|
||||
|
||||
class _Singleton(type):
|
||||
"""Metaclass to make the child, which should take zero initialisation arguments, a singleton
|
||||
"""Metaclass to make the child, which should take zero initialization arguments, a singleton
|
||||
object."""
|
||||
|
||||
def _get_singleton_instance(cls):
|
||||
|
@ -76,7 +76,7 @@ class Type:
|
|||
def __setstate__(self, state):
|
||||
_dict, slots = state
|
||||
for slot, value in slots.items():
|
||||
# We need to overcome the type's enforcement of immutability post initialisation.
|
||||
# We need to overcome the type's enforcement of immutability post initialization.
|
||||
super().__setattr__(slot, value)
|
||||
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ def unify_circuit_resources(circuits: Iterable[QuantumCircuit]) -> Iterable[Quan
|
|||
This function will preferentially try to mutate its inputs if they share an ordering, but if
|
||||
not, it will rebuild two new circuits. This is to avoid coupling too tightly to the inner
|
||||
class; there is no real support for deleting or re-ordering bits within a :obj:`.QuantumCircuit`
|
||||
context, and we don't want to rely on the *current* behaviour of the private APIs, since they
|
||||
context, and we don't want to rely on the *current* behavior of the private APIs, since they
|
||||
are very liable to change. No matter the method used, circuits with unified bits and registers
|
||||
are returned.
|
||||
"""
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"""Builder types for the basic control-flow constructs."""
|
||||
|
||||
# This file is in circuit.controlflow rather than the root of circuit because the constructs here
|
||||
# are only intended to be localised to constructing the control flow instructions. We anticipate
|
||||
# are only intended to be localized to constructing the control flow instructions. We anticipate
|
||||
# having a far more complete builder of all circuits, with more classical control and creation, in
|
||||
# the future.
|
||||
|
||||
|
@ -206,7 +206,7 @@ class InstructionPlaceholder(Instruction, abc.ABC):
|
|||
When appending a placeholder instruction into a circuit scope, you should create the
|
||||
placeholder, and then ask it what resources it should be considered as using from the start by
|
||||
calling :meth:`.InstructionPlaceholder.placeholder_instructions`. This set will be a subset of
|
||||
the final resources it asks for, but it is used for initialising resources that *must* be
|
||||
the final resources it asks for, but it is used for initializing resources that *must* be
|
||||
supplied, such as the bits used in the conditions of placeholder ``if`` statements.
|
||||
|
||||
.. warning::
|
||||
|
@ -360,7 +360,7 @@ class ControlFlowBuilderBlock(CircuitScopeInterface):
|
|||
which use a classical register as their condition.
|
||||
allow_jumps: Whether this builder scope should allow ``break`` and ``continue``
|
||||
statements within it. This is intended to help give sensible error messages when
|
||||
dangerous behaviour is encountered, such as using ``break`` inside an ``if`` context
|
||||
dangerous behavior is encountered, such as using ``break`` inside an ``if`` context
|
||||
manager that is not within a ``for`` manager. This can only be safe if the user is
|
||||
going to place the resulting :obj:`.QuantumCircuit` inside a :obj:`.ForLoopOp` that
|
||||
uses *exactly* the same set of resources. We cannot verify this from within the
|
||||
|
@ -395,7 +395,7 @@ class ControlFlowBuilderBlock(CircuitScopeInterface):
|
|||
def allow_jumps(self):
|
||||
"""Whether this builder scope should allow ``break`` and ``continue`` statements within it.
|
||||
|
||||
This is intended to help give sensible error messages when dangerous behaviour is
|
||||
This is intended to help give sensible error messages when dangerous behavior is
|
||||
encountered, such as using ``break`` inside an ``if`` context manager that is not within a
|
||||
``for`` manager. This can only be safe if the user is going to place the resulting
|
||||
:obj:`.QuantumCircuit` inside a :obj:`.ForLoopOp` that uses *exactly* the same set of
|
||||
|
|
|
@ -199,7 +199,7 @@ class IfElsePlaceholder(InstructionPlaceholder):
|
|||
super().__init__(
|
||||
"if_else", len(self.__resources.qubits), len(self.__resources.clbits), [], label=label
|
||||
)
|
||||
# Set the condition after super().__init__() has initialised it to None.
|
||||
# Set the condition after super().__init__() has initialized it to None.
|
||||
self.condition = validate_condition(condition)
|
||||
|
||||
def with_false_block(self, false_block: ControlFlowBuilderBlock) -> "IfElsePlaceholder":
|
||||
|
@ -236,7 +236,7 @@ class IfElsePlaceholder(InstructionPlaceholder):
|
|||
def _calculate_placeholder_resources(self) -> InstructionResources:
|
||||
"""Get the placeholder resources (see :meth:`.placeholder_resources`).
|
||||
|
||||
This is a separate function because we use the resources during the initialisation to
|
||||
This is a separate function because we use the resources during the initialization to
|
||||
determine how we should set our ``num_qubits`` and ``num_clbits``, so we implement the
|
||||
public version as a cache access for efficiency.
|
||||
"""
|
||||
|
|
|
@ -94,7 +94,7 @@ class SwitchCaseOp(ControlFlowOp):
|
|||
it's easier for things like `assign_parameters`, which need to touch each circuit object
|
||||
exactly once, to function."""
|
||||
self._label_spec: List[Tuple[Union[int, Literal[CASE_DEFAULT]], ...]] = []
|
||||
"""List of the normalised jump value specifiers. This is a list of tuples, where each tuple
|
||||
"""List of the normalized jump value specifiers. This is a list of tuples, where each tuple
|
||||
contains the values, and the indexing is the same as the values of `_case_map` and
|
||||
`_params`."""
|
||||
self._params = []
|
||||
|
|
|
@ -115,12 +115,12 @@ class Instruction(Operation):
|
|||
The "base class" of an instruction is the lowest class in its inheritance tree that the
|
||||
object should be considered entirely compatible with for _all_ circuit applications. This
|
||||
typically means that the subclass is defined purely to offer some sort of programmer
|
||||
convenience over the base class, and the base class is the "true" class for a behavioural
|
||||
convenience over the base class, and the base class is the "true" class for a behavioral
|
||||
perspective. In particular, you should *not* override :attr:`base_class` if you are
|
||||
defining a custom version of an instruction that will be implemented differently by
|
||||
hardware, such as an alternative measurement strategy, or a version of a parametrised gate
|
||||
hardware, such as an alternative measurement strategy, or a version of a parametrized gate
|
||||
with a particular set of parameters for the purposes of distinguishing it in a
|
||||
:class:`.Target` from the full parametrised gate.
|
||||
:class:`.Target` from the full parametrized gate.
|
||||
|
||||
This is often exactly equivalent to ``type(obj)``, except in the case of singleton instances
|
||||
of standard-library instructions. These singleton instances are special subclasses of their
|
||||
|
|
|
@ -119,7 +119,7 @@ class LinearAmplitudeFunction(QuantumCircuit):
|
|||
self._image = image
|
||||
self._rescaling_factor = rescaling_factor
|
||||
|
||||
# do rescalings
|
||||
# do rescaling
|
||||
a, b = domain
|
||||
c, d = image
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ class NLocal(BlueprintCircuit):
|
|||
self._bounds: list[tuple[float | None, float | None]] | None = None
|
||||
self._flatten = flatten
|
||||
|
||||
# During the build, if a subclass hasn't overridden our parametrisation methods, we can use
|
||||
# During the build, if a subclass hasn't overridden our parametrization methods, we can use
|
||||
# a newer fast-path method to parametrise the rotation and entanglement blocks if internally
|
||||
# those are just simple stdlib gates that have been promoted to circuits. We don't
|
||||
# precalculate the fast-path layers themselves because there's far too much that can be
|
||||
|
@ -1093,7 +1093,7 @@ def _stdlib_gate_from_simple_block(block: QuantumCircuit) -> _StdlibGateResult |
|
|||
return None
|
||||
instruction = block.data[0]
|
||||
# If the single instruction isn't a standard-library gate that spans the full width of the block
|
||||
# in the correct order, we're not simple. If the gate isn't fully parametrised with pure,
|
||||
# in the correct order, we're not simple. If the gate isn't fully parametrized with pure,
|
||||
# unique `Parameter` instances (expressions are too complex) that are in order, we're not
|
||||
# simple.
|
||||
if (
|
||||
|
|
|
@ -183,7 +183,7 @@ class _CUGateParams(list):
|
|||
# Magic numbers: CUGate has 4 parameters, UGate has 3, with the last of CUGate's missing.
|
||||
if isinstance(key, slice):
|
||||
# We don't need to worry about the case of the slice being used to insert extra / remove
|
||||
# elements because that would be "undefined behaviour" in a gate already, so we're
|
||||
# elements because that would be "undefined behavior" in a gate already, so we're
|
||||
# within our rights to do anything at all.
|
||||
for i, base_key in enumerate(range(*key.indices(4))):
|
||||
if base_key < 0:
|
||||
|
|
|
@ -972,7 +972,7 @@ class C4XGate(SingletonControlledGate):
|
|||
|
||||
_singleton_lookup_key = stdlib_singleton_key(num_ctrl_qubits=4)
|
||||
|
||||
# seems like open controls not hapening?
|
||||
# seems like open controls not happening?
|
||||
def _define(self):
|
||||
"""
|
||||
gate c3sqrtx a,b,c,d
|
||||
|
|
|
@ -62,7 +62,7 @@ class Parameter(ParameterExpression):
|
|||
__slots__ = ("_uuid", "_hash")
|
||||
|
||||
# This `__init__` does not call the super init, because we can't construct the
|
||||
# `_parameter_symbols` dictionary we need to pass to it before we're entirely initialised
|
||||
# `_parameter_symbols` dictionary we need to pass to it before we're entirely initialized
|
||||
# anyway, because `ParameterExpression` depends heavily on the structure of `Parameter`.
|
||||
|
||||
def __init__(
|
||||
|
|
|
@ -48,7 +48,7 @@ class ParameterExpression:
|
|||
expr (sympy.Expr): Expression of :class:`sympy.Symbol` s.
|
||||
"""
|
||||
# NOTE: `Parameter.__init__` does not call up to this method, since this method is dependent
|
||||
# on `Parameter` instances already being initialised enough to be hashable. If changing
|
||||
# on `Parameter` instances already being initialized enough to be hashable. If changing
|
||||
# this method, check that `Parameter.__init__` and `__setstate__` are still valid.
|
||||
self._parameter_symbols = symbol_map
|
||||
self._parameter_keys = frozenset(p._hash_key() for p in self._parameter_symbols)
|
||||
|
@ -421,8 +421,8 @@ class ParameterExpression:
|
|||
) from None
|
||||
# In symengine, if an expression was complex at any time, its type is likely to have
|
||||
# stayed "complex" even when the imaginary part symbolically (i.e. exactly)
|
||||
# cancelled out. Sympy tends to more aggressively recognise these as symbolically
|
||||
# real. This second attempt at a cast is a way of unifying the behaviour to the
|
||||
# cancelled out. Sympy tends to more aggressively recognize these as symbolically
|
||||
# real. This second attempt at a cast is a way of unifying the behavior to the
|
||||
# more expected form for our users.
|
||||
cval = complex(self)
|
||||
if cval.imag == 0.0:
|
||||
|
|
|
@ -111,7 +111,7 @@ BitType = TypeVar("BitType", Qubit, Clbit)
|
|||
#
|
||||
# If you're adding methods or attributes to `QuantumCircuit`, be sure to update the class docstring
|
||||
# to document them in a suitable place. The class is huge, so we do its documentation manually so
|
||||
# it has at least some amount of organisational structure.
|
||||
# it has at least some amount of organizational structure.
|
||||
|
||||
|
||||
class QuantumCircuit:
|
||||
|
@ -369,7 +369,7 @@ class QuantumCircuit:
|
|||
-------------------------------
|
||||
|
||||
A :class:`.Bit` instance is, on its own, just a unique handle for circuits to use in their own
|
||||
contexts. If you have got a :class:`.Bit` instance and a cirucit, just can find the contexts
|
||||
contexts. If you have got a :class:`.Bit` instance and a circuit, just can find the contexts
|
||||
that the bit exists in using :meth:`find_bit`, such as its integer index in the circuit and any
|
||||
registers it is contained in.
|
||||
|
||||
|
@ -650,7 +650,7 @@ class QuantumCircuit:
|
|||
|
||||
Finally, these methods apply particular generalized multiply controlled gates to the circuit,
|
||||
often with eager syntheses. They are listed in terms of the *base* gate they are controlling,
|
||||
since their exact output is often a synthesised version of a gate.
|
||||
since their exact output is often a synthesized version of a gate.
|
||||
|
||||
=============================== =================================================
|
||||
:class:`QuantumCircuit` method Base :mod:`qiskit.circuit.library` :class:`.Gate`
|
||||
|
@ -2500,7 +2500,7 @@ class QuantumCircuit:
|
|||
and the only reference to the circuit the instructions are being appended to is within
|
||||
that same function. In particular, it is not safe to call
|
||||
:meth:`QuantumCircuit._append` on a circuit that is received by a function argument.
|
||||
This is because :meth:`.QuantumCircuit._append` will not recognise the scoping
|
||||
This is because :meth:`.QuantumCircuit._append` will not recognize the scoping
|
||||
constructs of the control-flow builder interface.
|
||||
|
||||
Args:
|
||||
|
@ -2582,7 +2582,7 @@ class QuantumCircuit:
|
|||
|
||||
my_param = Parameter("my_param")
|
||||
|
||||
# Create a parametrised circuit.
|
||||
# Create a parametrized circuit.
|
||||
qc = QuantumCircuit(1)
|
||||
qc.rx(my_param, 0)
|
||||
|
||||
|
@ -2798,8 +2798,8 @@ class QuantumCircuit:
|
|||
# two classical registers we measured into above.
|
||||
qc.add_var(my_var, expr.bit_and(cr1, cr2))
|
||||
"""
|
||||
# Validate the initialiser first to catch cases where the variable to be declared is being
|
||||
# used in the initialiser.
|
||||
# Validate the initializer first to catch cases where the variable to be declared is being
|
||||
# used in the initializer.
|
||||
circuit_scope = self._current_scope()
|
||||
# Convenience method to widen Python integer literals to the right width during the initial
|
||||
# lift, if the type is already known via the variable.
|
||||
|
@ -2823,7 +2823,7 @@ class QuantumCircuit:
|
|||
var = name_or_var
|
||||
circuit_scope.add_uninitialized_var(var)
|
||||
try:
|
||||
# Store is responsible for ensuring the type safety of the initialisation.
|
||||
# Store is responsible for ensuring the type safety of the initialization.
|
||||
store = Store(var, initial)
|
||||
except CircuitError:
|
||||
circuit_scope.remove_var(var)
|
||||
|
@ -2853,7 +2853,7 @@ class QuantumCircuit:
|
|||
# name, and to be a bit less ergonomic than `add_var` (i.e. not allowing the (name, type)
|
||||
# overload) to discourage people from using it when they should use `add_var`.
|
||||
#
|
||||
# This function exists so that there is a method to emulate `copy_empty_like`'s behaviour of
|
||||
# This function exists so that there is a method to emulate `copy_empty_like`'s behavior of
|
||||
# adding uninitialised variables, which there's no obvious way around. We need to be sure
|
||||
# that _some_ sort of handling of uninitialised variables is taken into account in our
|
||||
# structures, so that doesn't become a huge edge case, even though we make no assertions
|
||||
|
@ -2887,7 +2887,7 @@ class QuantumCircuit:
|
|||
"""
|
||||
if self._control_flow_scopes:
|
||||
# Allow manual capturing. Not sure why it'd be useful, but there's a clear expected
|
||||
# behaviour here.
|
||||
# behavior here.
|
||||
self._control_flow_scopes[-1].use_var(var)
|
||||
return
|
||||
if self._vars_input:
|
||||
|
@ -3656,7 +3656,7 @@ class QuantumCircuit:
|
|||
if vars_mode == "alike":
|
||||
# Note that this causes the local variables to be uninitialised, because the stores are
|
||||
# not copied. This can leave the circuit in a potentially dangerous state for users if
|
||||
# they don't re-add initialiser stores.
|
||||
# they don't re-add initializer stores.
|
||||
cpy._vars_local = self._vars_local.copy()
|
||||
cpy._vars_input = self._vars_input.copy()
|
||||
cpy._vars_capture = self._vars_capture.copy()
|
||||
|
@ -4061,7 +4061,7 @@ class QuantumCircuit:
|
|||
angle (float, ParameterExpression): radians
|
||||
"""
|
||||
# If we're currently parametric, we need to throw away the references. This setter is
|
||||
# called by some subclasses before the inner `_global_phase` is initialised.
|
||||
# called by some subclasses before the inner `_global_phase` is initialized.
|
||||
if isinstance(getattr(self._data, "global_phase", None), ParameterExpression):
|
||||
self._parameters = None
|
||||
if isinstance(angle, ParameterExpression):
|
||||
|
@ -4273,7 +4273,7 @@ class QuantumCircuit:
|
|||
target._increment_instances()
|
||||
target._name_update()
|
||||
|
||||
# Normalise the inputs into simple abstract interfaces, so we've dispatched the "iteration"
|
||||
# Normalize the inputs into simple abstract interfaces, so we've dispatched the "iteration"
|
||||
# logic in one place at the start of the function. This lets us do things like calculate
|
||||
# and cache expensive properties for (e.g.) the sequence format only if they're used; for
|
||||
# many large, close-to-hardware circuits, we won't need the extra handling for
|
||||
|
@ -5909,7 +5909,7 @@ class QuantumCircuit:
|
|||
"""Finish a scope used in the control-flow builder interface, and return it to the caller.
|
||||
|
||||
This should only be done by the control-flow context managers, since they naturally
|
||||
synchronise the creation and deletion of stack elements."""
|
||||
synchronize the creation and deletion of stack elements."""
|
||||
return self._control_flow_scopes.pop()
|
||||
|
||||
def _peek_previous_instruction_in_scope(self) -> CircuitInstruction:
|
||||
|
|
|
@ -193,7 +193,8 @@ def random_circuit(
|
|||
# Apply arbitrary random operations in layers across all qubits.
|
||||
for layer_number in range(depth):
|
||||
# We generate all the randomness for the layer in one go, to avoid many separate calls to
|
||||
# the randomisation routines, which can be fairly slow.
|
||||
# the randomization routines, which can be fairly slow.
|
||||
|
||||
# This reliably draws too much randomness, but it's less expensive than looping over more
|
||||
# calls to the rng. After, trim it down by finding the point when we've used all the qubits.
|
||||
|
||||
|
@ -239,9 +240,9 @@ def random_circuit(
|
|||
if not gate_added_flag:
|
||||
break
|
||||
|
||||
# For efficiency in the Python loop, this uses Numpy vectorisation to pre-calculate the
|
||||
# For efficiency in the Python loop, this uses Numpy vectorization to pre-calculate the
|
||||
# indices into the lists of qubits and parameters for every gate, and then suitably
|
||||
# randomises those lists.
|
||||
# randomizes those lists.
|
||||
q_indices = np.empty(len(gate_specs) + 1, dtype=np.int64)
|
||||
p_indices = np.empty(len(gate_specs) + 1, dtype=np.int64)
|
||||
q_indices[0] = p_indices[0] = 0
|
||||
|
|
|
@ -42,7 +42,7 @@ The same can be true for, for example, :class:`.Measure`, except that it's a sub
|
|||
heart of Qiskit's data model for circuits.
|
||||
|
||||
From a library-author perspective, the minimum that is needed to enhance a :class:`.Gate` or
|
||||
:class:`~.circuit.Instruction` with this behaviour is to inherit from :class:`SingletonGate`
|
||||
:class:`~.circuit.Instruction` with this behavior is to inherit from :class:`SingletonGate`
|
||||
(:class:`SingletonInstruction`) instead of :class:`.Gate` (:class:`~.circuit.Instruction`), and for
|
||||
the ``__init__`` method to have defaults for all of its arguments (these will be the state of the
|
||||
singleton instance). For example::
|
||||
|
@ -175,7 +175,7 @@ Implementation
|
|||
This section is primarily developer documentation for the code; none of the machinery described
|
||||
here is public, and it is not safe to inherit from any of it directly.
|
||||
|
||||
There are several moving parts to tackle here. The behaviour of having ``XGate()`` return some
|
||||
There are several moving parts to tackle here. The behavior of having ``XGate()`` return some
|
||||
singleton object that is an (inexact) instance of :class:`.XGate` but *without* calling ``__init__``
|
||||
requires us to override :class:`type.__call__ <type>`. This means that :class:`.XGate` must have a
|
||||
metaclass that defines ``__call__`` to return the singleton instance.
|
||||
|
@ -484,7 +484,7 @@ class _SingletonInstructionOverrides(Instruction):
|
|||
instruction._define()
|
||||
# We use this `list` subclass that rejects all mutation rather than a simple `tuple` because
|
||||
# the `params` typing is specified as `list`. Various places in the library and beyond do
|
||||
# `x.params.copy()` when they want to produce a version they own, which is good behaviour,
|
||||
# `x.params.copy()` when they want to produce a version they own, which is good behavior,
|
||||
# and would fail if we switched to a `tuple`, which has no `copy` method.
|
||||
instruction._params = _frozenlist(instruction._params)
|
||||
return instruction
|
||||
|
|
|
@ -62,7 +62,7 @@ def circuit_to_instruction(circuit, parameter_map=None, equivalence_library=None
|
|||
|
||||
if circuit.num_input_vars:
|
||||
# This could be supported by moving the `input` variables to be parameters of the
|
||||
# instruction, but we don't really have a good reprssentation of that yet, so safer to
|
||||
# instruction, but we don't really have a good representation of that yet, so safer to
|
||||
# forbid it.
|
||||
raise QiskitError("Circuits with 'input' variables cannot yet be converted to instructions")
|
||||
if circuit.num_captured_vars:
|
||||
|
|
|
@ -1525,7 +1525,7 @@ class DAGCircuit:
|
|||
)[0]
|
||||
self._multi_graph.add_edge(pred._node_id, succ._node_id, contracted_var)
|
||||
|
||||
# Exlude any nodes from in_dag that are not a DAGOpNode or are on
|
||||
# Exclude any nodes from in_dag that are not a DAGOpNode or are on
|
||||
# wires outside the set specified by the wires kwarg
|
||||
def filter_fn(node):
|
||||
if not isinstance(node, DAGOpNode):
|
||||
|
@ -1615,7 +1615,7 @@ class DAGCircuit:
|
|||
be used.
|
||||
propagate_condition (bool): Optional, default True. If True, a condition on the
|
||||
``node`` to be replaced will be applied to the new ``op``. This is the legacy
|
||||
behaviour. If either node is a control-flow operation, this will be ignored. If
|
||||
behavior. If either node is a control-flow operation, this will be ignored. If
|
||||
the ``op`` already has a condition, :exc:`.DAGCircuitError` is raised.
|
||||
|
||||
Returns:
|
||||
|
|
|
@ -225,7 +225,7 @@ class BasePassManager(ABC):
|
|||
in_programs = [in_programs]
|
||||
is_list = False
|
||||
|
||||
# If we're not going to run in parallel, we want to avoid spending time `dill` serialising
|
||||
# If we're not going to run in parallel, we want to avoid spending time `dill` serializing
|
||||
# ourselves, since that can be quite expensive.
|
||||
if len(in_programs) == 1 or not should_run_in_parallel(num_processes):
|
||||
out = [
|
||||
|
@ -242,7 +242,7 @@ class BasePassManager(ABC):
|
|||
# Pass manager may contain callable and we need to serialize through dill rather than pickle.
|
||||
# See https://github.com/Qiskit/qiskit-terra/pull/3290
|
||||
# Note that serialized object is deserialized as a different object.
|
||||
# Thus, we can resue the same manager without state collision, without building it per thread.
|
||||
# Thus, we can reuse the same manager without state collision, without building it per thread.
|
||||
return parallel_map(
|
||||
_run_workflow_in_new_process,
|
||||
values=in_programs,
|
||||
|
|
|
@ -203,7 +203,7 @@ class BaseEstimatorV2(ABC):
|
|||
|
||||
@staticmethod
|
||||
def _make_data_bin(_: EstimatorPub) -> type[DataBin]:
|
||||
# this method is present for backwards compat. new primitive implementatinos
|
||||
# this method is present for backwards compat. new primitive implementations
|
||||
# should avoid it.
|
||||
return DataBin
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ class BindingsArray(ShapedMixin):
|
|||
be inferred from the provided arrays. Ambiguity arises whenever the key of an entry of
|
||||
``data`` contains only one parameter and the corresponding array's shape ends in a one.
|
||||
In this case, it can't be decided whether that one is an index over parameters, or whether
|
||||
it should be encorporated in :attr:`~shape`.
|
||||
it should be incorporated in :attr:`~shape`.
|
||||
|
||||
Since :class:`~.Parameter` objects are only allowed to represent float values, this
|
||||
class casts all given values to float. If an incompatible dtype is given, such as complex
|
||||
|
@ -131,7 +131,7 @@ class BindingsArray(ShapedMixin):
|
|||
|
||||
def __getitem__(self, args) -> BindingsArray:
|
||||
# because the parameters live on the last axis, we don't need to do anything special to
|
||||
# accomodate them because there will always be an implicit slice(None, None, None)
|
||||
# accommodate them because there will always be an implicit slice(None, None, None)
|
||||
# on all unspecified trailing dimensions
|
||||
# separately, we choose to not disallow args which touch the last dimension, even though it
|
||||
# would not be a particularly friendly way to chop parameters
|
||||
|
|
|
@ -86,7 +86,7 @@ class BackendV1(Backend, ABC):
|
|||
|
||||
..
|
||||
This next bit is necessary just because autosummary generally won't summarise private
|
||||
methods; changing that behaviour would have annoying knock-on effects through all the
|
||||
methods; changing that behavior would have annoying knock-on effects through all the
|
||||
rest of the documentation, so instead we just hard-code the automethod directive.
|
||||
"""
|
||||
self._configuration = configuration
|
||||
|
|
|
@ -116,7 +116,7 @@ class Options(Mapping):
|
|||
def __setitem__(self, key, value):
|
||||
self.update_options(**{key: value})
|
||||
|
||||
# backwards-compatibilty with Qiskit Experiments:
|
||||
# backwards-compatibility with Qiskit Experiments:
|
||||
|
||||
@property
|
||||
def __dict__(self):
|
||||
|
|
|
@ -20,7 +20,7 @@ formats <qasm2-parse>` and :ref:`exporting back to OpenQASM 2 <qasm2-export>`.
|
|||
|
||||
.. note::
|
||||
|
||||
OpenQASM 2 is a simple language, and not suitable for general serialisation of Qiskit objects.
|
||||
OpenQASM 2 is a simple language, and not suitable for general serialization of Qiskit objects.
|
||||
See :ref:`some discussion of alternatives below <qasm2-alternatives>`, if that is what you are
|
||||
looking for.
|
||||
|
||||
|
@ -95,7 +95,7 @@ letter-of-the-spec mode with ``strict=True``.
|
|||
Exporting API
|
||||
=============
|
||||
|
||||
Similar to other serialisation modules in Python, this module offers two public functions:
|
||||
Similar to other serialization modules in Python, this module offers two public functions:
|
||||
:func:`dump` and :func:`dumps`, which take a :class:`.QuantumCircuit` and write out a representative
|
||||
OpenQASM 2 program to a file-like object or return a string, respectively.
|
||||
|
||||
|
@ -394,7 +394,7 @@ Legacy Compatibility
|
|||
|
||||
:meth:`.QuantumCircuit.from_qasm_str` and :meth:`~.QuantumCircuit.from_qasm_file` used to make a few
|
||||
additions on top of the raw specification. Qiskit originally tried to use OpenQASM 2 as a sort of
|
||||
serialisation format, and expanded its behaviour as Qiskit expanded. The new parser under all its
|
||||
serialization format, and expanded its behavior as Qiskit expanded. The new parser under all its
|
||||
defaults implements the specification more strictly.
|
||||
|
||||
In particular, in the legacy importers:
|
||||
|
@ -445,11 +445,11 @@ In particular, in the legacy importers:
|
|||
* the parsed grammar is effectively the same as :ref:`the strict mode of the new importers
|
||||
<qasm2-strict-mode>`.
|
||||
|
||||
You can emulate this behaviour in :func:`load` and :func:`loads` by setting `include_path`
|
||||
You can emulate this behavior in :func:`load` and :func:`loads` by setting `include_path`
|
||||
appropriately (try inspecting the variable ``qiskit.__file__`` to find the installed location), and
|
||||
by passing a list of :class:`CustomInstruction` instances for each of the custom gates you care
|
||||
about. To make things easier we make three tuples available, which each contain one component of
|
||||
a configuration that is equivalent to Qiskit's legacy converter behaviour.
|
||||
a configuration that is equivalent to Qiskit's legacy converter behavior.
|
||||
|
||||
.. py:data:: LEGACY_CUSTOM_INSTRUCTIONS
|
||||
|
||||
|
@ -473,7 +473,7 @@ On *all* the gates defined in Qiskit's legacy version of ``qelib1.inc`` and the
|
|||
instruction, it does not matter how the gates are actually defined and used, the legacy importer
|
||||
will always attempt to output its custom objects for them. This can result in errors during the
|
||||
circuit construction, even after a successful parse. There is no way to emulate this buggy
|
||||
behaviour with :mod:`qiskit.qasm2`; only an ``include "qelib1.inc";`` statement or the
|
||||
behavior with :mod:`qiskit.qasm2`; only an ``include "qelib1.inc";`` statement or the
|
||||
`custom_instructions` argument can cause built-in Qiskit instructions to be used, and the signatures
|
||||
of these match each other.
|
||||
|
||||
|
@ -549,7 +549,7 @@ LEGACY_INCLUDE_PATH = (
|
|||
|
||||
|
||||
def _normalize_path(path: Union[str, os.PathLike]) -> str:
|
||||
"""Normalise a given path into a path-like object that can be passed to Rust.
|
||||
"""Normalize a given path into a path-like object that can be passed to Rust.
|
||||
|
||||
Ideally this would be something that we can convert to Rust's `OSString`, but in practice,
|
||||
Python uses `os.fsencode` to produce a `bytes` object, but this doesn't map especially well.
|
||||
|
|
|
@ -308,7 +308,7 @@ def _define_custom_operation(operation, gates_to_define):
|
|||
lib.U3Gate,
|
||||
}
|
||||
|
||||
# In known-good situations we want to use a manually parametrised object as the source of the
|
||||
# In known-good situations we want to use a manually parametrized object as the source of the
|
||||
# definition, but still continue to return the given object as the call-site object.
|
||||
if operation.base_class in known_good_parameterized:
|
||||
parameterized_operation = type(operation)(*_FIXED_PARAMETERS[: len(operation.params)])
|
||||
|
|
|
@ -287,7 +287,7 @@ def from_bytecode(bytecode, custom_instructions: Iterable[CustomInstruction]):
|
|||
|
||||
class _DefinedGate(Gate):
|
||||
"""A gate object defined by a `gate` statement in an OpenQASM 2 program. This object lazily
|
||||
binds its parameters to its definition, so it is only synthesised when required."""
|
||||
binds its parameters to its definition, so it is only synthesized when required."""
|
||||
|
||||
def __init__(self, name, num_qubits, params, gates, bytecode):
|
||||
self._gates = gates
|
||||
|
|
|
@ -317,7 +317,7 @@ class Designator(ASTNode):
|
|||
|
||||
|
||||
class ClassicalDeclaration(Statement):
|
||||
"""Declaration of a classical type, optionally initialising it to a value."""
|
||||
"""Declaration of a classical type, optionally initializing it to a value."""
|
||||
|
||||
def __init__(self, type_: ClassicalType, identifier: Identifier, initializer=None):
|
||||
self.type = type_
|
||||
|
|
|
@ -467,7 +467,7 @@ class QASM3Builder:
|
|||
self.build_gate_definition(instruction) for instruction in gates_to_declare
|
||||
]
|
||||
|
||||
# Early IBM runtime paramterisation uses unbound `Parameter` instances as `input` variables,
|
||||
# Early IBM runtime parametrization uses unbound `Parameter` instances as `input` variables,
|
||||
# not the explicit realtime `Var` variables, so we need this explicit scan.
|
||||
self.hoist_global_parameter_declarations()
|
||||
# Qiskit's clbits and classical registers need to get mapped to implicit OQ3 variables, but
|
||||
|
@ -681,7 +681,7 @@ class QASM3Builder:
|
|||
doesn't involve the declaration of *new* bits or registers in inner scopes; only the
|
||||
:class:`.expr.Var` mechanism allows that.
|
||||
|
||||
The behaviour of this function depends on the setting ``allow_aliasing``. If this
|
||||
The behavior of this function depends on the setting ``allow_aliasing``. If this
|
||||
is ``True``, then the output will be in the same form as the output of
|
||||
:meth:`.build_classical_declarations`, with the registers being aliases. If ``False``, it
|
||||
will instead return a :obj:`.ast.ClassicalDeclaration` for each classical register, and one
|
||||
|
@ -942,7 +942,7 @@ class QASM3Builder:
|
|||
),
|
||||
]
|
||||
|
||||
# Handle the stabilised syntax.
|
||||
# Handle the stabilized syntax.
|
||||
cases = []
|
||||
default = None
|
||||
for values, block in instruction.operation.cases_specifier():
|
||||
|
|
|
@ -89,7 +89,7 @@ class InstructionToQobjConverter:
|
|||
The transfer layer format must be the text representation that coforms to
|
||||
the `OpenPulse specification<https://arxiv.org/abs/1809.03452>`__.
|
||||
Extention to the OpenPulse can be achieved by subclassing this this with
|
||||
extra methods corresponding to each augumented instruction. For example,
|
||||
extra methods corresponding to each augmented instruction. For example,
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
@ -503,7 +503,7 @@ class QobjToInstructionConverter:
|
|||
The transfer layer format must be the text representation that coforms to
|
||||
the `OpenPulse specification<https://arxiv.org/abs/1809.03452>`__.
|
||||
Extention to the OpenPulse can be achieved by subclassing this this with
|
||||
extra methods corresponding to each augumented instruction. For example,
|
||||
extra methods corresponding to each augmented instruction. For example,
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
|
@ -522,7 +522,7 @@ def read_schedule_block(file_obj, version, metadata_deserializer=None, use_symen
|
|||
metadata_deserializer (JSONDecoder): An optional JSONDecoder class
|
||||
that will be used for the ``cls`` kwarg on the internal
|
||||
``json.load`` call used to deserialize the JSON payload used for
|
||||
the :attr:`.ScheduleBlock.metadata` attribute for a schdule block
|
||||
the :attr:`.ScheduleBlock.metadata` attribute for a schedule block
|
||||
in the file-like object. If this is not specified the circuit metadata will
|
||||
be parsed as JSON with the stdlib ``json.load()`` function using
|
||||
the default ``JSONDecoder`` class.
|
||||
|
|
|
@ -159,7 +159,7 @@ class Condition(IntEnum):
|
|||
"""Type keys for the ``conditional_key`` field of the INSTRUCTION struct."""
|
||||
|
||||
# This class is deliberately raw integers and not in terms of ASCII characters for backwards
|
||||
# compatiblity in the form as an old Boolean value was expanded; `NONE` and `TWO_TUPLE` must
|
||||
# compatibility in the form as an old Boolean value was expanded; `NONE` and `TWO_TUPLE` must
|
||||
# have the enumeration values 0 and 1.
|
||||
|
||||
NONE = 0
|
||||
|
@ -276,7 +276,7 @@ class ScheduleInstruction(TypeKeyBase):
|
|||
REFERENCE = b"y"
|
||||
|
||||
# 's' is reserved by ScheduleBlock, i.e. block can be nested as an element.
|
||||
# Call instructon is not supported by QPY.
|
||||
# Call instruction is not supported by QPY.
|
||||
# This instruction has been excluded from ScheduleBlock instructions with
|
||||
# qiskit-terra/#8005 and new instruction Reference will be added instead.
|
||||
# Call is only applied to Schedule which is not supported by QPY.
|
||||
|
|
|
@ -228,7 +228,7 @@ def _choi_to_kraus(data, input_dim, output_dim, atol=ATOL_DEFAULT):
|
|||
# This should be a call to la.eigh, but there is an OpenBlas
|
||||
# threading issue that is causing segfaults.
|
||||
# Need schur here since la.eig does not
|
||||
# guarentee orthogonality in degenerate subspaces
|
||||
# guarantee orthogonality in degenerate subspaces
|
||||
w, v = la.schur(data, output="complex")
|
||||
w = w.diagonal().real
|
||||
# Check eigenvalues are non-negative
|
||||
|
|
|
@ -97,7 +97,7 @@ class CNOTDihedral(BaseOperator, AdjointMixin):
|
|||
with optimal number of two qubit gates*, `Quantum 4(369), 2020
|
||||
<https://quantum-journal.org/papers/q-2020-12-07-369/>`_
|
||||
2. Andrew W. Cross, Easwar Magesan, Lev S. Bishop, John A. Smolin and Jay M. Gambetta,
|
||||
*Scalable randomised benchmarking of non-Clifford gates*,
|
||||
*Scalable randomized benchmarking of non-Clifford gates*,
|
||||
npj Quantum Inf 2, 16012 (2016).
|
||||
"""
|
||||
|
||||
|
@ -325,7 +325,7 @@ class CNOTDihedral(BaseOperator, AdjointMixin):
|
|||
with optimal number of two qubit gates*, `Quantum 4(369), 2020
|
||||
<https://quantum-journal.org/papers/q-2020-12-07-369/>`_
|
||||
2. Andrew W. Cross, Easwar Magesan, Lev S. Bishop, John A. Smolin and Jay M. Gambetta,
|
||||
*Scalable randomised benchmarking of non-Clifford gates*,
|
||||
*Scalable randomized benchmarking of non-Clifford gates*,
|
||||
npj Quantum Inf 2, 16012 (2016).
|
||||
"""
|
||||
# pylint: disable=cyclic-import
|
||||
|
|
|
@ -316,7 +316,7 @@ def diamond_norm(choi: Choi | QuantumChannel, solver: str = "SCS", **kwargs) ->
|
|||
iden = sparse.eye(dim_out)
|
||||
|
||||
# Watrous uses row-vec convention for his Choi matrix while we use
|
||||
# col-vec. It turns out row-vec convention is requried for CVXPY too
|
||||
# col-vec. It turns out row-vec convention is required for CVXPY too
|
||||
# since the cvxpy.kron function must have a constant as its first argument.
|
||||
c_r = cvxpy.bmat([[cvxpy.kron(iden, r0_r), x_r], [x_r.T, cvxpy.kron(iden, r1_r)]])
|
||||
c_i = cvxpy.bmat([[cvxpy.kron(iden, r0_i), x_i], [-x_i.T, cvxpy.kron(iden, r1_i)]])
|
||||
|
|
|
@ -185,7 +185,7 @@ class Clifford(BaseOperator, AdjointMixin, Operation):
|
|||
isinstance(data, (list, np.ndarray))
|
||||
and (data_asarray := np.asarray(data, dtype=bool)).ndim == 2
|
||||
):
|
||||
# This little dance is to avoid Numpy 1/2 incompatiblities between the availability
|
||||
# This little dance is to avoid Numpy 1/2 incompatibilities between the availability
|
||||
# and meaning of the 'copy' argument in 'array' and 'asarray', when the input needs
|
||||
# its dtype converting. 'asarray' prefers to return 'self' if possible in both.
|
||||
if copy and np.may_share_memory(data, data_asarray):
|
||||
|
|
|
@ -646,7 +646,7 @@ class PauliList(BasePauli, LinearMixin, GroupMixin):
|
|||
index = index[sort_inds]
|
||||
unique = PauliList(BasePauli(self._z[index], self._x[index], self._phase[index]))
|
||||
|
||||
# Concatinate return tuples
|
||||
# Concatenate return tuples
|
||||
ret = (unique,)
|
||||
if return_index:
|
||||
ret += (index,)
|
||||
|
|
|
@ -163,7 +163,7 @@ def _sample_qmallows(n, rng=None):
|
|||
if rng is None:
|
||||
rng = np.random.default_rng()
|
||||
|
||||
# Hadmard layer
|
||||
# Hadamard layer
|
||||
had = np.zeros(n, dtype=bool)
|
||||
|
||||
# Permutation layer
|
||||
|
|
|
@ -297,7 +297,7 @@ class StabilizerState(QuantumState):
|
|||
|
||||
# Otherwise pauli is (-1)^a prod_j S_j^b_j for Clifford stabilizers
|
||||
# If pauli anti-commutes with D_j then b_j = 1.
|
||||
# Multiply pauli by stabilizers with anti-commuting destabilizers
|
||||
# Multiply pauli by stabilizers with anti-commuting destabilisers
|
||||
pauli_z = (pauli.z).copy() # Make a copy of pauli.z
|
||||
for p in range(num_qubits):
|
||||
# Check if destabilizer anti-commutes
|
||||
|
@ -646,7 +646,7 @@ class StabilizerState(QuantumState):
|
|||
|
||||
@staticmethod
|
||||
def _rowsum_deterministic(clifford, aux_pauli, row):
|
||||
"""Updating an auxilary Pauli aux_pauli in the
|
||||
"""Updating an auxiliary Pauli aux_pauli in the
|
||||
deterministic rowsum calculation.
|
||||
The StabilizerState itself is not updated."""
|
||||
|
||||
|
@ -680,8 +680,8 @@ class StabilizerState(QuantumState):
|
|||
Args:
|
||||
qubits (range): range of qubits
|
||||
outcome (list[str]): outcome being built
|
||||
outcome_prob (float): probabilitiy of the outcome
|
||||
probs (dict[str, float]): holds the outcomes and probabilitiy results
|
||||
outcome_prob (float): probability of the outcome
|
||||
probs (dict[str, float]): holds the outcomes and probability results
|
||||
outcome_bitstring (str): target outcome to measure which reduces measurements, None
|
||||
if not targeting a specific target
|
||||
"""
|
||||
|
@ -694,7 +694,7 @@ class StabilizerState(QuantumState):
|
|||
if outcome[i] == "X":
|
||||
# Retrieve the qubit for the current measurement
|
||||
qubit = qubits[(len(qubits) - i - 1)]
|
||||
# Determine if the probabilitiy is deterministic
|
||||
# Determine if the probability is deterministic
|
||||
if not any(ret.clifford.stab_x[:, qubit]):
|
||||
single_qubit_outcome: np.int64 = ret._measure_and_update(qubit, 0)
|
||||
if outcome_bitstring is None or (
|
||||
|
|
|
@ -101,7 +101,7 @@ class Counts(dict):
|
|||
else:
|
||||
raise TypeError(
|
||||
"Invalid input key type %s, must be either an int "
|
||||
"key or string key with hexademical value or bit string"
|
||||
"key or string key with hexadecimal value or bit string"
|
||||
)
|
||||
header = {}
|
||||
self.creg_sizes = creg_sizes
|
||||
|
|
|
@ -412,7 +412,7 @@ def _calc_pauli_diff(cliff, cliff_target):
|
|||
|
||||
|
||||
def synth_clifford_depth_lnn(cliff):
|
||||
"""Synthesis of a :class:`.Clifford` into layers for linear-nearest neighbour connectivity.
|
||||
"""Synthesis of a :class:`.Clifford` into layers for linear-nearest neighbor connectivity.
|
||||
|
||||
The depth of the synthesized n-qubit circuit is bounded by :math:`7n+2`, which is not optimal.
|
||||
It should be replaced by a better algorithm that provides depth bounded by :math:`7n-4` [3].
|
||||
|
|
|
@ -40,7 +40,7 @@ def synth_cnotdihedral_full(elem: CNOTDihedral) -> QuantumCircuit:
|
|||
with optimal number of two qubit gates*, `Quantum 4(369), 2020
|
||||
<https://quantum-journal.org/papers/q-2020-12-07-369/>`_
|
||||
2. Andrew W. Cross, Easwar Magesan, Lev S. Bishop, John A. Smolin and Jay M. Gambetta,
|
||||
*Scalable randomised benchmarking of non-Clifford gates*,
|
||||
*Scalable randomized benchmarking of non-Clifford gates*,
|
||||
npj Quantum Inf 2, 16012 (2016).
|
||||
"""
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ def synth_cnotdihedral_general(elem: CNOTDihedral) -> QuantumCircuit:
|
|||
|
||||
References:
|
||||
1. Andrew W. Cross, Easwar Magesan, Lev S. Bishop, John A. Smolin and Jay M. Gambetta,
|
||||
*Scalable randomised benchmarking of non-Clifford gates*,
|
||||
*Scalable randomized benchmarking of non-Clifford gates*,
|
||||
npj Quantum Inf 2, 16012 (2016).
|
||||
"""
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ class SolovayKitaevDecomposition:
|
|||
gate_matrix_su2 = GateSequence.from_matrix(z * gate_matrix)
|
||||
global_phase = np.arctan2(np.imag(z), np.real(z))
|
||||
|
||||
# get the decompositon as GateSequence type
|
||||
# get the decomposition as GateSequence type
|
||||
decomposition = self._recurse(gate_matrix_su2, recursion_degree, check_input=check_input)
|
||||
|
||||
# simplify
|
||||
|
|
|
@ -210,7 +210,7 @@ def _north_west_to_identity(n, mat):
|
|||
def _optimize_cx_circ_depth_5n_line(mat):
|
||||
# Optimize CX circuit in depth bounded by 5n for LNN connectivity.
|
||||
# The algorithm [1] has two steps:
|
||||
# a) transform the originl matrix to a north-west matrix (m2nw),
|
||||
# a) transform the original matrix to a north-west matrix (m2nw),
|
||||
# b) transform the north-west matrix to identity (nw2id).
|
||||
#
|
||||
# A square n-by-n matrix A is called north-west if A[i][j]=0 for all i+j>=n
|
||||
|
|
|
@ -39,7 +39,7 @@ from qiskit.synthesis.linear.linear_depth_lnn import _optimize_cx_circ_depth_5n_
|
|||
def _initialize_phase_schedule(mat_z):
|
||||
"""
|
||||
Given a CZ layer (represented as an n*n CZ matrix Mz)
|
||||
Return a scheudle of phase gates implementing Mz in a SWAP-only netwrok
|
||||
Return a schedule of phase gates implementing Mz in a SWAP-only netwrok
|
||||
(c.f. Alg 1, [2])
|
||||
"""
|
||||
n = len(mat_z)
|
||||
|
@ -173,7 +173,7 @@ def _apply_phase_to_nw_circuit(n, phase_schedule, seq, swap_plus):
|
|||
of exactly n layers of boxes, each being either a SWAP or a SWAP+. That is,
|
||||
each northwest diagonalization circuit can be uniquely represented by which
|
||||
of its n(n-1)/2 boxes are SWAP+ and which are SWAP.
|
||||
Return a QuantumCircuit that computes the phase scheudle S inside CX
|
||||
Return a QuantumCircuit that computes the phase schedule S inside CX
|
||||
"""
|
||||
cir = QuantumCircuit(n)
|
||||
|
||||
|
@ -217,7 +217,7 @@ def _apply_phase_to_nw_circuit(n, phase_schedule, seq, swap_plus):
|
|||
|
||||
def synth_cx_cz_depth_line_my(mat_x: np.ndarray, mat_z: np.ndarray) -> QuantumCircuit:
|
||||
"""
|
||||
Joint synthesis of a -CZ-CX- circuit for linear nearest neighbour (LNN) connectivity,
|
||||
Joint synthesis of a -CZ-CX- circuit for linear nearest neighbor (LNN) connectivity,
|
||||
with 2-qubit depth at most 5n, based on Maslov and Yang.
|
||||
This method computes the CZ circuit inside the CX circuit via phase gate insertions.
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ def _create_patterns(n):
|
|||
|
||||
|
||||
def synth_cz_depth_line_mr(mat: np.ndarray) -> QuantumCircuit:
|
||||
r"""Synthesis of a CZ circuit for linear nearest neighbour (LNN) connectivity,
|
||||
r"""Synthesis of a CZ circuit for linear nearest neighbor (LNN) connectivity,
|
||||
based on Maslov and Roetteler.
|
||||
|
||||
Note that this method *reverts* the order of qubits in the circuit,
|
||||
|
|
|
@ -166,7 +166,7 @@ def _calc_pauli_diff_stabilizer(cliff, cliff_target):
|
|||
|
||||
|
||||
def synth_stabilizer_depth_lnn(stab: StabilizerState) -> QuantumCircuit:
|
||||
"""Synthesis of an n-qubit stabilizer state for linear-nearest neighbour connectivity,
|
||||
"""Synthesis of an n-qubit stabilizer state for linear-nearest neighbor connectivity,
|
||||
in 2-qubit depth :math:`2n+2` and two distinct CX layers, using :class:`.CXGate`\\ s and phase gates
|
||||
(:class:`.SGate`, :class:`.SdgGate` or :class:`.ZGate`).
|
||||
|
||||
|
|
|
@ -782,7 +782,7 @@ class TwoQubitDecomposeUpToDiagonal:
|
|||
|
||||
# This weird duplicated lazy structure is for backwards compatibility; Qiskit has historically
|
||||
# always made ``two_qubit_cnot_decompose`` available publicly immediately on import, but it's quite
|
||||
# expensive to construct, and we want to defer the obejct's creation until it's actually used. We
|
||||
# expensive to construct, and we want to defer the object's creation until it's actually used. We
|
||||
# only need to pass through the public methods that take `self` as a parameter. Using `__getattr__`
|
||||
# doesn't work because it is only called if the normal resolution methods fail. Using
|
||||
# `__getattribute__` is too messy for a simple one-off use object.
|
||||
|
|
|
@ -133,7 +133,7 @@ def _get_connectivity(num_qubits: int, connectivity: str) -> dict:
|
|||
links = {i: list(range(num_qubits)) for i in range(num_qubits)}
|
||||
|
||||
elif connectivity == "line":
|
||||
# Every qubit is connected to its immediate neighbours only.
|
||||
# Every qubit is connected to its immediate neighbors only.
|
||||
links = {i: [i - 1, i, i + 1] for i in range(1, num_qubits - 1)}
|
||||
|
||||
# first qubit
|
||||
|
|
|
@ -269,7 +269,7 @@ def _apply_a2(circ):
|
|||
# rolling over diagonals
|
||||
ind2 = None # lint
|
||||
for ind1, ind2 in zip(ind2q[0:-1:], ind2q[1::]):
|
||||
# get neigboring 2q gates separated by controls
|
||||
# get neighboring 2q gates separated by controls
|
||||
instr1 = ccirc.data[ind1]
|
||||
mat1 = Operator(instr1.operation).data
|
||||
instr2 = ccirc.data[ind2]
|
||||
|
|
|
@ -466,7 +466,7 @@ class BasisSearchVisitor(rustworkx.visit.DijkstraVisitor):
|
|||
score,
|
||||
)
|
||||
self._basis_transforms.append((gate.name, gate.num_qubits, rule.params, rule.circuit))
|
||||
# we can stop the search if we have found all gates in the original ciruit.
|
||||
# we can stop the search if we have found all gates in the original circuit.
|
||||
if not self._source_gates_remain:
|
||||
# if we start from source gates and apply `basis_transforms` in reverse order, we'll end
|
||||
# up with gates in the target basis. Note though that `basis_transforms` may include
|
||||
|
@ -548,7 +548,7 @@ def _basis_search(equiv_lib, source_basis, target_basis):
|
|||
if not source_basis:
|
||||
return []
|
||||
|
||||
# This is only neccessary since gates in target basis are currently reported by
|
||||
# This is only necessary since gates in target basis are currently reported by
|
||||
# their names and we need to have in addition the number of qubits they act on.
|
||||
target_basis_keys = [key for key in equiv_lib.keys() if key.name in target_basis]
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ class SabreLayout(TransformationPass):
|
|||
with the ``routing_pass`` argument and an error will be raised
|
||||
if both are used.
|
||||
layout_trials (int): The number of random seed trials to run
|
||||
layout with. When > 1 the trial that resuls in the output with
|
||||
layout with. When > 1 the trial that results in the output with
|
||||
the fewest swap gates will be selected. If this is not specified
|
||||
(and ``routing_pass`` is not set) then the number of local
|
||||
physical CPUs will be used as the default value. This option is
|
||||
|
@ -420,7 +420,7 @@ class SabreLayout(TransformationPass):
|
|||
)
|
||||
|
||||
def _ancilla_allocation_no_pass_manager(self, dag):
|
||||
"""Run the ancilla-allocation and -enlargment passes on the DAG chained onto our
|
||||
"""Run the ancilla-allocation and -enlargement passes on the DAG chained onto our
|
||||
``property_set``, skipping the DAG-to-circuit conversion cost of using a ``PassManager``."""
|
||||
ancilla_pass = FullAncillaAllocation(self.coupling_map)
|
||||
ancilla_pass.property_set = self.property_set
|
||||
|
|
|
@ -195,7 +195,7 @@ class VF2Layout(AnalysisPass):
|
|||
if len(cm_graph) == len(im_graph):
|
||||
chosen_layout = mapping_to_layout(layout_mapping)
|
||||
break
|
||||
# If there is no error map avilable we can just skip the scoring stage as there
|
||||
# If there is no error map available we can just skip the scoring stage as there
|
||||
# is nothing to score with, so any match is the best we can find.
|
||||
if self.avg_error_map is None:
|
||||
chosen_layout = mapping_to_layout(layout_mapping)
|
||||
|
|
|
@ -75,7 +75,7 @@ class CommutativeCancellation(TransformationPass):
|
|||
var_z_gate = None
|
||||
z_var_gates = [gate for gate in dag.count_ops().keys() if gate in self._var_z_map]
|
||||
if z_var_gates:
|
||||
# priortize z gates in circuit
|
||||
# prioritize z gates in circuit
|
||||
var_z_gate = self._var_z_map[next(iter(z_var_gates))]
|
||||
else:
|
||||
z_var_gates = [gate for gate in self.basis if gate in self._var_z_map]
|
||||
|
|
|
@ -622,7 +622,7 @@ class BackwardMatch:
|
|||
)
|
||||
self.matching_list.append_scenario(new_matching_scenario)
|
||||
|
||||
# Third option: if blocking the succesors breaks a match, we consider
|
||||
# Third option: if blocking the successors breaks a match, we consider
|
||||
# also the possibility to block all predecessors (push the gate to the left).
|
||||
if broken_matches and all(global_broken):
|
||||
|
||||
|
|
|
@ -507,7 +507,7 @@ class TemplateSubstitution:
|
|||
to_native_symbolic = lambda x: x
|
||||
|
||||
circuit_params, template_params = [], []
|
||||
# Set of all parameter names that are present in the circuits to be optimised.
|
||||
# Set of all parameter names that are present in the circuits to be optimized.
|
||||
circuit_params_set = set()
|
||||
|
||||
template_dag_dep = copy.deepcopy(self.template_dag_dep)
|
||||
|
|
|
@ -260,7 +260,7 @@ class StarPreRouting(TransformationPass):
|
|||
# star block by a linear sequence of gates
|
||||
new_dag, qubit_mapping = self.star_preroute(dag, star_blocks, processing_order)
|
||||
|
||||
# Fix output permuation -- copied from ElidePermutations
|
||||
# Fix output permutation -- copied from ElidePermutations
|
||||
input_qubit_mapping = {qubit: index for index, qubit in enumerate(dag.qubits)}
|
||||
self.property_set["original_layout"] = Layout(input_qubit_mapping)
|
||||
if self.property_set["original_qubit_indices"] is None:
|
||||
|
|
|
@ -44,7 +44,7 @@ Pulse alignment constraint
|
|||
multiple of this value. Violation of this constraint may result in the
|
||||
backend execution failure.
|
||||
|
||||
In most of the senarios, the scheduled start time of ``DAGOpNode`` corresponds to the
|
||||
In most of the scenarios, the scheduled start time of ``DAGOpNode`` corresponds to the
|
||||
start time of the underlying pulse instruction composing the node operation.
|
||||
However, this assumption can be intentionally broken by defining a pulse gate,
|
||||
i.e. calibration, with the schedule involving pre-buffer, i.e. some random pulse delay
|
||||
|
@ -62,7 +62,7 @@ Granularity constraint
|
|||
This value is reported by ``timing_constraints["granularity"]`` in the backend
|
||||
configuration in units of dt. This is the constraint for a single pulse :class:`Play`
|
||||
instruction that may constitute your pulse gate.
|
||||
The length of waveform samples should be multipel of this constraint value.
|
||||
The length of waveform samples should be multiple of this constraint value.
|
||||
Violation of this constraint may result in failue in backend execution.
|
||||
|
||||
Minimum pulse length constraint
|
||||
|
|
|
@ -68,7 +68,7 @@ class BaseSchedulerTransform(TransformationPass):
|
|||
However, such optimization should be done by another pass,
|
||||
otherwise scheduling may break topological ordering of the original circuit.
|
||||
|
||||
Realistic control flow scheduling respecting for microarcitecture
|
||||
Realistic control flow scheduling respecting for microarchitecture
|
||||
|
||||
In the dispersive QND readout scheme, qubit is measured with microwave stimulus to qubit (Q)
|
||||
followed by resonator ring-down (depopulation). This microwave signal is recorded
|
||||
|
|
|
@ -130,7 +130,7 @@ class DynamicalDecoupling(TransformationPass):
|
|||
will be used [d/2, d, d, ..., d, d, d/2].
|
||||
skip_reset_qubits (bool): if True, does not insert DD on idle
|
||||
periods that immediately follow initialized/reset qubits (as
|
||||
qubits in the ground state are less susceptile to decoherence).
|
||||
qubits in the ground state are less susceptible to decoherence).
|
||||
target (Target): The :class:`~.Target` representing the target backend, if both
|
||||
``durations`` and this are specified then this argument will take
|
||||
precedence and ``durations`` will be ignored.
|
||||
|
|
|
@ -202,7 +202,7 @@ class BasePadding(TransformationPass):
|
|||
):
|
||||
"""Add new operation to DAG with scheduled information.
|
||||
|
||||
This is identical to apply_operation_back + updating the node_start_time propety.
|
||||
This is identical to apply_operation_back + updating the node_start_time property.
|
||||
|
||||
Args:
|
||||
dag: DAG circuit on which the sequence is applied.
|
||||
|
|
|
@ -128,7 +128,7 @@ class PadDynamicalDecoupling(BasePadding):
|
|||
will be used [d/2, d, d, ..., d, d, d/2].
|
||||
skip_reset_qubits: If True, does not insert DD on idle periods that
|
||||
immediately follow initialized/reset qubits
|
||||
(as qubits in the ground state are less susceptile to decoherence).
|
||||
(as qubits in the ground state are less susceptible to decoherence).
|
||||
pulse_alignment: The hardware constraints for gate timing allocation.
|
||||
This is usually provided from ``backend.configuration().timing_constraints``.
|
||||
If provided, the delay length, i.e. ``spacing``, is implicitly adjusted to
|
||||
|
@ -311,7 +311,7 @@ class PadDynamicalDecoupling(BasePadding):
|
|||
# slack = 992 dt - 4 x 160 dt = 352 dt
|
||||
#
|
||||
# unconstraind sequence: 44dt-X1-88dt-Y2-88dt-X3-88dt-Y4-44dt
|
||||
# constraind sequence : 32dt-X1-80dt-Y2-80dt-X3-80dt-Y4-32dt + extra slack 48 dt
|
||||
# constrained sequence : 32dt-X1-80dt-Y2-80dt-X3-80dt-Y4-32dt + extra slack 48 dt
|
||||
#
|
||||
# Now we evenly split extra slack into start and end of the sequence.
|
||||
# The distributed slack should be multiple of 16.
|
||||
|
|
|
@ -414,7 +414,7 @@ class UnitarySynthesis(TransformationPass):
|
|||
if self.method == "default":
|
||||
# If the method is the default, we only need to evaluate one set of keyword arguments.
|
||||
# To simplify later logic, and avoid cases where static analysis might complain that we
|
||||
# haven't initialised the "default" handler, we rebind the names so they point to the
|
||||
# haven't initialized the "default" handler, we rebind the names so they point to the
|
||||
# same object as the chosen method.
|
||||
default_method = plugin_method
|
||||
default_kwargs = plugin_kwargs
|
||||
|
|
|
@ -67,7 +67,7 @@ class GateDirection(TransformationPass):
|
|||
└──────┘ └───┘└──────┘└───┘
|
||||
|
||||
This pass assumes that the positions of the qubits in the :attr:`.DAGCircuit.qubits` attribute
|
||||
are the physical qubit indicies. For example if ``dag.qubits[0]`` is qubit 0 in the
|
||||
are the physical qubit indices. For example if ``dag.qubits[0]`` is qubit 0 in the
|
||||
:class:`.CouplingMap` or :class:`.Target`.
|
||||
"""
|
||||
|
||||
|
|
|
@ -338,7 +338,7 @@ class StagedPassManager(PassManager):
|
|||
"scheduling",
|
||||
]
|
||||
self._validate_stages(stages)
|
||||
# Set through parent class since `__setattr__` requieres `expanded_stages` to be defined
|
||||
# Set through parent class since `__setattr__` requires `expanded_stages` to be defined
|
||||
super().__setattr__("_stages", tuple(stages))
|
||||
super().__setattr__("_expanded_stages", tuple(self._generate_expanded_stages()))
|
||||
super().__init__()
|
||||
|
|
|
@ -31,7 +31,7 @@ class _lift_to_method: # pylint: disable=invalid-name
|
|||
returned unchanged if so, otherwise it is turned into the default implementation for functions,
|
||||
which makes them bindable to instances.
|
||||
|
||||
Python-space functions and lambdas already have this behaviour, but builtins like ``print``
|
||||
Python-space functions and lambdas already have this behavior, but builtins like ``print``
|
||||
don't; using this class allows us to do::
|
||||
|
||||
wrap_method(MyClass, "maybe_mutates_arguments", before=print, after=print)
|
||||
|
@ -49,7 +49,7 @@ class _lift_to_method: # pylint: disable=invalid-name
|
|||
|
||||
def __init__(self, method):
|
||||
if method is self:
|
||||
# Prevent double-initialisation if we are passed an instance of this object to lift.
|
||||
# Prevent double-initialization if we are passed an instance of this object to lift.
|
||||
return
|
||||
self._method = method
|
||||
|
||||
|
@ -118,7 +118,7 @@ class _WrappedMethod:
|
|||
|
||||
|
||||
def wrap_method(cls: Type, name: str, *, before: Callable = None, after: Callable = None):
|
||||
"""Wrap the functionality the instance- or class method ``cls.name`` with additional behaviour
|
||||
"""Wrap the functionality the instance- or class method ``cls.name`` with additional behavior
|
||||
``before`` and ``after``.
|
||||
|
||||
This mutates ``cls``, replacing the attribute ``name`` with the new functionality. This is
|
||||
|
|
|
@ -174,7 +174,7 @@ class LazyDependencyManager(abc.ABC):
|
|||
|
||||
def require_in_instance(self, feature_or_class):
|
||||
"""A class decorator that requires the dependency is available when the class is
|
||||
initialised. This decorator can be used even if the class does not define an ``__init__``
|
||||
initialized. This decorator can be used even if the class does not define an ``__init__``
|
||||
method.
|
||||
|
||||
Args:
|
||||
|
@ -186,7 +186,7 @@ class LazyDependencyManager(abc.ABC):
|
|||
|
||||
Returns:
|
||||
Callable: a class decorator that ensures that the wrapped feature is present if the
|
||||
class is initialised.
|
||||
class is initialized.
|
||||
"""
|
||||
if isinstance(feature_or_class, str):
|
||||
feature = feature_or_class
|
||||
|
|
|
@ -79,7 +79,7 @@ External Python Libraries
|
|||
|
||||
* - .. py:data:: HAS_IPYTHON
|
||||
- If `the IPython kernel <https://ipython.org/>`__ is available, certain additional
|
||||
visualisations and line magics are made available.
|
||||
visualizations and line magics are made available.
|
||||
|
||||
* - .. py:data:: HAS_IPYWIDGETS
|
||||
- Monitoring widgets for jobs running on external backends can be provided if `ipywidgets
|
||||
|
@ -94,7 +94,7 @@ External Python Libraries
|
|||
interactivity features.
|
||||
|
||||
* - .. py:data:: HAS_MATPLOTLIB
|
||||
- Qiskit provides several visualisation tools in the :mod:`.visualization` module.
|
||||
- Qiskit provides several visualization tools in the :mod:`.visualization` module.
|
||||
Almost all of these are built using `Matplotlib <https://matplotlib.org/>`__, which must
|
||||
be installed in order to use them.
|
||||
|
||||
|
@ -116,7 +116,7 @@ External Python Libraries
|
|||
:class:`.DAGCircuit` in certain modes.
|
||||
|
||||
* - .. py:data:: HAS_PYDOT
|
||||
- For some graph visualisations, Qiskit uses `pydot <https://github.com/pydot/pydot>`__ as an
|
||||
- For some graph visualizations, Qiskit uses `pydot <https://github.com/pydot/pydot>`__ as an
|
||||
interface to GraphViz (see :data:`HAS_GRAPHVIZ`).
|
||||
|
||||
* - .. py:data:: HAS_PYGMENTS
|
||||
|
@ -134,7 +134,7 @@ External Python Libraries
|
|||
<https://qiskit.github.io/qiskit-qasm3-import>`__.
|
||||
|
||||
* - .. py:data:: HAS_SEABORN
|
||||
- Qiskit provides several visualisation tools in the :mod:`.visualization` module. Some
|
||||
- Qiskit provides several visualization tools in the :mod:`.visualization` module. Some
|
||||
of these are built using `Seaborn <https://seaborn.pydata.org/>`__, which must be installed
|
||||
in order to use them.
|
||||
|
||||
|
@ -179,16 +179,16 @@ External Command-Line Tools
|
|||
:widths: 25 75
|
||||
|
||||
* - .. py:data:: HAS_GRAPHVIZ
|
||||
- For some graph visualisations, Qiskit uses the `GraphViz <https://graphviz.org/>`__
|
||||
visualisation tool via its ``pydot`` interface (see :data:`HAS_PYDOT`).
|
||||
- For some graph visualizations, Qiskit uses the `GraphViz <https://graphviz.org/>`__
|
||||
visualization tool via its ``pydot`` interface (see :data:`HAS_PYDOT`).
|
||||
|
||||
* - .. py:data:: HAS_PDFLATEX
|
||||
- Visualisation tools that use LaTeX in their output, such as the circuit drawers, require
|
||||
- Visualization tools that use LaTeX in their output, such as the circuit drawers, require
|
||||
``pdflatex`` to be available. You will generally need to ensure that you have a working
|
||||
LaTeX installation available, and the ``qcircuit.tex`` package.
|
||||
|
||||
* - .. py:data:: HAS_PDFTOCAIRO
|
||||
- Visualisation tools that convert LaTeX-generated files into rasterised images use the
|
||||
- Visualization tools that convert LaTeX-generated files into rasterized images use the
|
||||
``pdftocairo`` tool. This is part of the `Poppler suite of PDF tools
|
||||
<https://poppler.freedesktop.org/>`__.
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ def get_gate_ctrl_text(op, drawer, style=None, calibrations=None):
|
|||
gate_text = gate_text.replace("-", "\\mbox{-}")
|
||||
ctrl_text = f"$\\mathrm{{{ctrl_text}}}$"
|
||||
|
||||
# Only captitalize internally-created gate or instruction names
|
||||
# Only capitalize internally-created gate or instruction names
|
||||
elif (
|
||||
(gate_text == op.name and op_type not in (Gate, Instruction))
|
||||
or (gate_text == base_name and base_type not in (Gate, Instruction))
|
||||
|
|
|
@ -196,7 +196,7 @@ class ChannelEvents:
|
|||
|
||||
def get_frame_changes(self) -> Iterator[PulseInstruction]:
|
||||
"""Return frame change type instructions with total frame change amount."""
|
||||
# TODO parse parametrised FCs correctly
|
||||
# TODO parse parametrized FCs correctly
|
||||
|
||||
sorted_frame_changes = sorted(self._frames.items(), key=lambda x: x[0])
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ template: |
|
|||
New features related to the qiskit.qpy module.
|
||||
features_quantum_info:
|
||||
- |
|
||||
New features releated to the qiskit.quantum_info module.
|
||||
New features related to the qiskit.quantum_info module.
|
||||
features_synthesis:
|
||||
- |
|
||||
New features related to the qiskit.synthesis module.
|
||||
|
@ -178,7 +178,7 @@ template: |
|
|||
Deprecations related to the qiskit.qpy module.
|
||||
deprecations_quantum_info:
|
||||
- |
|
||||
Deprecations releated to the qiskit.quantum_info module.
|
||||
Deprecations related to the qiskit.quantum_info module.
|
||||
deprecations_synthesis:
|
||||
- |
|
||||
Deprecations related to the qiskit.synthesis module.
|
||||
|
|
|
@ -22,4 +22,4 @@ upgrade:
|
|||
from the right hand side of the operation if the left does not have
|
||||
``__mul__`` defined) implements scalar multiplication (i.e.
|
||||
:meth:`qiskit.quantum_info.Operator.multiply`). Previously both methods
|
||||
implemented scalar multiplciation.
|
||||
implemented scalar multiplication.
|
||||
|
|
|
@ -8,7 +8,7 @@ prelude: |
|
|||
structure behind all operations to be based on
|
||||
`retworkx <https://pypi.org/project/retworkx/>`_ for greatly improved
|
||||
performance. Circuit transpilation speed in the 0.13.0 release should
|
||||
be significanlty faster than in previous releases.
|
||||
be significantly faster than in previous releases.
|
||||
|
||||
There has been a significant simplification to the style in which Pulse
|
||||
instructions are built. Now, ``Command`` s are deprecated and a unified
|
||||
|
|
|
@ -8,4 +8,4 @@ features:
|
|||
* :meth:`~qiskit.providers.BaseJob.cancelled`
|
||||
* :meth:`~qiskit.providers.BaseJob.in_final_state`
|
||||
|
||||
These methods are used to check wheter a job is in a given job status.
|
||||
These methods are used to check whether a job is in a given job status.
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
fixes:
|
||||
- |
|
||||
Fixes a case in :meth:`qiskit.result.Result.get_counts`, where the results
|
||||
for an expirement could not be referenced if the experiment was initialized
|
||||
for an experiment could not be referenced if the experiment was initialized
|
||||
as a Schedule without a name. Fixes
|
||||
`#2753 <https://github.com/Qiskit/qiskit-terra/issues/2753>`_
|
||||
|
|
|
@ -11,7 +11,7 @@ features:
|
|||
the number of two-qubit gates.
|
||||
- |
|
||||
Adds :class:`qiskit.quantum_info.SparsePauliOp` operator class. This is an
|
||||
efficient representaiton of an N-qubit matrix that is sparse in the Pauli
|
||||
efficient representation of an N-qubit matrix that is sparse in the Pauli
|
||||
basis and uses a :class:`qiskit.quantum_info.PauliTable` and vector of
|
||||
complex coefficients for its data structure.
|
||||
|
||||
|
@ -23,7 +23,7 @@ features:
|
|||
Numpy arrays or :class:`~qiskit.quantum_info.Operator` objects can be
|
||||
converted to a :class:`~qiskit.quantum_info.SparsePauliOp` using the
|
||||
`:class:`~qiskit.quantum_info.SparsePauliOp.from_operator` method.
|
||||
:class:`~qiskit.quantum_info.SparsePauliOp` can be convered to a sparse
|
||||
:class:`~qiskit.quantum_info.SparsePauliOp` can be converted to a sparse
|
||||
csr_matrix or dense Numpy array using the
|
||||
:class:`~qiskit.quantum_info.SparsePauliOp.to_matrix` method, or to an
|
||||
:class:`~qiskit.quantum_info.Operator` object using the
|
||||
|
@ -54,7 +54,7 @@ features:
|
|||
:meth:`~qiskit.quantum_info.PauliTable.tensor`) between each element
|
||||
of the first table, with each element of the second table.
|
||||
|
||||
* Addition of two tables acts as list concatination of the terms in each
|
||||
* Addition of two tables acts as list concatenation of the terms in each
|
||||
table (``+``).
|
||||
|
||||
* Pauli tables can be sorted by lexicographic (tensor product) order or
|
||||
|
@ -148,7 +148,7 @@ upgrade:
|
|||
n_qubits = 10
|
||||
ham = ScalarOp(2 ** n_qubits, coeff=0)
|
||||
|
||||
# Add 2-body nearest neighbour terms
|
||||
# Add 2-body nearest neighbor terms
|
||||
for j in range(n_qubits - 1):
|
||||
ham = ham + ZZ([j, j+1])
|
||||
- |
|
||||
|
|
|
@ -175,7 +175,7 @@ deprecations:
|
|||
The ``add``, ``subtract``, and ``multiply`` methods of the
|
||||
:class:`qiskit.quantum_info.Statevector` and
|
||||
:class:`qiskit.quantum_info.DensityMatrix` classes are deprecated and will
|
||||
be removed in a future release. Instead you shoulde use ``+``, ``-``, ``*``
|
||||
be removed in a future release. Instead you should use ``+``, ``-``, ``*``
|
||||
binary operators instead.
|
||||
- |
|
||||
Deprecates :meth:`qiskit.quantum_info.Statevector.to_counts`,
|
||||
|
|
|
@ -6,7 +6,7 @@ features:
|
|||
single qubit gate transitions has been added. It takes in a single qubit
|
||||
circuit and returns an animation of qubit state transitions on a Bloch
|
||||
sphere. To use this function you must have installed
|
||||
the dependencies for and configured globally a matplotlib animtion
|
||||
the dependencies for and configured globally a matplotlib animation
|
||||
writer. You can refer to the `matplotlib documentation
|
||||
<https://matplotlib.org/api/animation_api.html#writer-classes>`_ for
|
||||
more details on this. However, in the default case simply ensuring
|
||||
|
|
|
@ -5,4 +5,4 @@ features:
|
|||
been added to the :class:`~qiskit.circuit.ParameterExpression` class.
|
||||
This enables calling ``numpy.conj()`` without raising an error. Since a
|
||||
:class:`~qiskit.circuit.ParameterExpression` object is real, it will
|
||||
return itself. This behaviour is analogous to Python floats/ints.
|
||||
return itself. This behavior is analogous to Python floats/ints.
|
||||
|
|
|
@ -43,7 +43,7 @@ features:
|
|||
of scheduled circuits.
|
||||
|
||||
- |
|
||||
A new fuction :func:`qiskit.compiler.sequence` has been also added so that
|
||||
A new function :func:`qiskit.compiler.sequence` has been also added so that
|
||||
we can convert a scheduled circuit into a :class:`~qiskit.pulse.Schedule`
|
||||
to make it executable on a pulse-enabled backend.
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue