qoqo.operations.DefinitionComplex

class qoqo.operations.DefinitionComplex

DefinitionComplex is the Definition for a Complex type register.

Parameters:
  • name (string) – The name of the register that is defined.

  • length (int) – The length of the register that is defined, usually the number of qubits to be measured.

  • is_output (bool) – True/False if the variable is an output to the program.

__init__()

Methods

__init__()

hqslang()

Returns hqslang name of Operation

involved_qubits()

List all involved Qubits

is_output()

Get value of struct field is_output

is_parametrized()

Returns true if operation contains symbolic parameters

length()

Get value of struct field length

name()

Return name of definition operation.

remap_qubits(mapping)

Remap qubits

substitute_parameters(substitution_parameters)

Substitutes internal symbolic parameters with float values

tags()

Returns tags identifying the Operation

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_output()

Get value of struct field is_output

is_parametrized()

Returns true if operation contains symbolic parameters

Returns:

bool

length()

Get value of struct field length

name()

Return name of definition operation.

Returns:

str

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]