Enum roqoqo::QuantumProgram[][src]

pub enum QuantumProgram {
    BasisRotation {
        measurement: BasisRotation,
        input_parameter_names: Vec<String>,
    },
    CheatedBasisRotation {
        measurement: CheatedBasisRotation,
        input_parameter_names: Vec<String>,
    },
    Cheated {
        measurement: Cheated,
        input_parameter_names: Vec<String>,
    },
    ClassicalRegister {
        measurement: ClassicalRegister,
        input_parameter_names: Vec<String>,
    },
}
Expand description

Represents a quantum program evaluating measurements based on a one or more free float parameters.

The main use of QuantumProgram is to contain a Measurements implementing crate::measurements::Measure that measures expectation values or output registers of crate::Circuit quantum circuits that contain symbolic parameters. Circuit with symbolic parameters can not be simulated or executed on real hardware. The symbolic parameters need to be replaced with real floating point numbers first. A QuantumProgram contains a list of the free parameters (input_parameter_names) and can automatically replace the parameters with its run methods and return the result.

The QuantumProgram should correspond as closely as possible to a normal mulit-parameter function in classical computing that can be called with a set of parameters and returns a result. It is the intended way to interface between normal program code and roqoqo based quantum programs.

Variants

BasisRotation

Variant for basis rotation measurement based quantum programs

Fields of BasisRotation

measurement: BasisRotation

The measurement that is performed

input_parameter_names: Vec<String>

List of free input parameters that can be set when the QuantumProgram is executed

CheatedBasisRotation

Variant for cheated basis rotation measurement based quantum programs

Fields of CheatedBasisRotation

measurement: CheatedBasisRotation

The measurement that is performed

input_parameter_names: Vec<String>

List of free input parameters that can be set when the QuantumProgram is executed

Cheated

Variant for statevector/density matrix based measurements

Fields of Cheated

measurement: Cheated

The measurement that is performed

input_parameter_names: Vec<String>

List of free input parameters that can be set when the QuantumProgram is executed

ClassicalRegister

Variant quantum programs returning full classical registers

Fields of ClassicalRegister

measurement: ClassicalRegister

The measurement that is performed

input_parameter_names: Vec<String>

List of free input parameters that can be set when the QuantumProgram is executed

Implementations

Runs the QuantumProgram and returns expectation values.

Runs the quantum programm for a given set of parameters passed in the same order as the parameters listed in input_parameter_names and returns expectation values.

Arguments:

  • backend - The backend the program is executed on.
  • parameters - List of float (f64) parameters of the function call in order of input_parameter_names

Runs the QuantumProgram and returns the classical registers of the quantum program.

Runs the quantum programm for a given set of parameters passed in the same order as the parameters listed in input_parameter_names and returns the classical register output.
The classical registers usually contain a record of measurement values for the repeated execution of a crate::Circuit quantum circuit for real quantum hardware or the readout of the statevector or the density matrix for simulators.

Arguments:

  • backend - The backend the program is executed on.
  • parameters - List of float (f64) parameters of the function call in order of input_parameter_names

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

Deserialize this value from the given Serde deserializer. Read more

Implements the Display trait for QuantumProgram.

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

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.

Performs the conversion.

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)

recently added

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

Converts the given value to a String. 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.