mqt.qudits.quantum_circuit.gate¶

Module Contents¶

class Instruction(name: str)[source]¶

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

class Gate(circuit: QuantumCircuit, name: str, gate_type: enum, target_qudits: list[int] | int, dimensions: list[int] | int, params: list | ndarray | None = None, control_set=None, label: str | None = None, duration=None, unit='dt')[source]¶

Bases: Instruction

Unitary gate_matrix.

property reference_lines¶
property get_control_lines¶
property control_info¶
abstract __array__() ndarray[source]¶
dag()[source]¶
to_matrix(identities=0) ndarray[source]¶

Return a np.ndarray for the gate_matrix unitary parameters.

Returns:

if the Gate subclass has a parameters definition.

Return type:

np.ndarray

Raises:

CircuitError – If a Gate subclass does not implement this method an exception will be raised when this base class method is called.

control(indices: list[int] | int, ctrl_states: list[int] | int)[source]¶
abstract validate_parameter(parameter)[source]¶
__qasm__() str[source]¶

Generate QASM for Gate export

abstract __str__() str[source]¶

Return str(self).

check_long_range()[source]¶
set_gate_type_single() None[source]¶
set_gate_type_two() None[source]¶
set_gate_type_multi() None[source]¶
return_custom_data() str[source]¶