pub struct CheatedBasisRotationInputWrapper {
    pub internal: CheatedBasisRotationInput,
}
Expand description

Collected information for executing a cheated basis rotation measurement.

Fields

internal: CheatedBasisRotationInput

Internal storage of [roqoqo::CheatedBasisRotationInput].

Implementations

Create new CheatedBasisRotationInput.

The CheatedBasisRotationInput starts with just the number of qubtis and flipped measurements set. The pauli_poduct_qubit_masks and measured_exp_vals start empty and can be extended with CheatedBasisRotationInput::add_linear_exp_val and CheatedBasisRotationInput::add_symbolic_exp_val.

Returns: self: The new instance of BasisRotationInput with pauli_product_qubit_masks = an empty dictionary, the specified number of qubits in input, number_pauli_products = 0, measured_exp_vals = an empty dictionary, and whether to use flipped measurements as specified in input.

Add measured Pauli product to CheatedBasisRotationInput and returns index of Pauli product.

When the pauli product is already in the measurement input the function only returns its index.

Args: readout (str): The name of the readout register containing the pauli_product expectation value.

Returns: int: The index of the added Pauli product in the list of all Pauli products.

Add linear definition of expectation value to measurement input.

Adds an expectation value that is defined by a linear combination of expectation values of Pauli products.

Args: name (str): The name of the expectation value. linear (dict[int, float]): The linear combination of expectation values as a map between Pauli product index and coefficient.

Raises: RuntimeError: Failed to add linear expectation value.

Add symbolic definition of expectation value to measurement input.

Adds an expectation value that is defined by a symbolic combination of expectation values of Pauli products.

Args: name (str): The name of the expectation value. symbolic (str): The symbolic expression for the expectation values given by qoqo_calculator::CalculatorFloat.

Raises: RuntimeError: Failed to add symbolic expectation value.

The i-th PauliProducts are hardcoded as variables pauli_product_i in the string expression of CalculatorFloat.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Specify this class has #[pyclass(dict)] or not.

Specify this class has #[pyclass(weakref)] or not.

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict. Read more

Class doc string

#[pyclass(gc)]

#[pyclass(subclass)]

#[pyclass(extends=…)]

Layout

Base class

This handles following two situations: Read more

Utility type to make Py::as_ref work.

Class name.

Module name, if any.

PyTypeObject instance for this type.

Checks if object is an instance of this type or a subclass of this type.

Checks if object is an instance of this type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Extracts Self from the source PyObject.

Performs the conversion.

Arguments for exception

Returns the safe abstraction over the type object.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.