qoqo.operations.PragmaGetPauliProduct

class qoqo.operations.PragmaGetPauliProduct

This PRAGMA measurement operation returns a Pauli product expectation value.

This PRAGMA operation returns a Pauli product expectation value after applying a Rotate to another basis. It performs all of the operation on a clone of the quantum register, sothat the actual quantum register remains unchanged.

Parameters:
  • qubit_paulis (dict[int, int]) – The dictionary of the pauli matrix to apply to each qubit in the form {qubit: pauli}. Allowed values to be provided for ‘pauli’ are: 0 = identity, 1 = PauliX, 2 = PauliY, 3 = PauliZ.

  • readout (string) – The name of the classical readout register.

  • circuit (Circuit) – The measurement preparation Circuit, applied on a copy of the register before measurement.

__init__()

Methods

__init__()

circuit()

Get value of struct field circuit

hqslang()

Returns hqslang name of Operation

involved_qubits()

List all involved Qubits

is_parametrized()

Returns true if operation contains symbolic parameters

qubit_paulis()

Get value of struct field qubit_paulis

readout()

Get value of struct field readout

remap_qubits(mapping)

Remap qubits

substitute_parameters(substitution_parameters)

Substitutes internal symbolic parameters with float values

tags()

Returns tags identifying the Operation

circuit()

Get value of struct field circuit

hqslang()

Returns hqslang name of Operation

Returns:

The name

Return type:

str

involved_qubits()

List all involved Qubits

Returns:

The involved qubits as a set or ‘ALL’ if all qubits are involved

Return type:

Union[set[int], str]

is_parametrized()

Returns true if operation contains symbolic parameters

Returns:

bool

qubit_paulis()

Get value of struct field qubit_paulis

readout()

Get value of struct field readout

remap_qubits(mapping)

Remap qubits

Parameters:

mapping (dict[int, int]) – The mapping

Returns:

The operation with the remapped qubits

Return type:

Operation

Raises:

RuntimeError – Qubit remapping failed

substitute_parameters(substitution_parameters)

Substitutes internal symbolic parameters with float values

Only available when all symbolic expressions can be evaluated to float with the provided parameters.

Parameters:

substitution_parameters (dict[str, float]) – The substituted free parameters

Returns:

The operation with the parameters substituted

Return type:

Operation

Raises:

RuntimeError – Parameter Substitution failed

tags()

Returns tags identifying the Operation

Returns:

The tags identifying the operation

Return type:

list[str]