qoqo.operations.PragmaOverrotation

class qoqo.operations.PragmaOverrotation

The statistical overrotation PRAGMA operation.

This PRAGMA applies a statistical overrotation to the next rotation gate in the circuit, which matches the hqslang name in the gate parameter of PragmaOverrotation and the involved qubits in qubits.

The applied overrotation corresponds to adding a random number to the rotation angle. The random number is drawn from a normal distribution with mean 0 and standard deviation variance and is multiplied by the amplitude.

Parameters:
  • gate (str) – The unique hqslang name of the gate to overrotate.

  • qubits (list[int]) – The qubits of the gate to overrotate.

  • amplitude (float) – The amplitude the random number is multiplied by.

  • variance (float) – The standard deviation of the normal distribution the random number is drawn from.

__init__()

Methods

__init__()

amplitude()

Get value of struct field amplitude

gate_hqslang()

Get value of struct field gate_hqslang

hqslang()

Returns hqslang name of Operation

involved_qubits()

List all involved Qubits

is_parametrized()

Returns true if operation contains symbolic parameters

qubits()

Return list of qubits of the multi qubit operation in order of descending significance

remap_qubits(mapping)

Remap qubits

substitute_parameters(substitution_parameters)

Substitutes internal symbolic parameters with float values

tags()

Returns tags identifying the Operation

variance()

Get value of struct field variance

amplitude()

Get value of struct field amplitude

gate_hqslang()

Get value of struct field gate_hqslang

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

qubits()

Return list of qubits of the multi qubit operation in order of descending significance

Returns:

list[int]

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]

variance()

Get value of struct field variance