iqm.pulse.circuit_operations.get_unitary_from_circuit

iqm.pulse.circuit_operations.get_unitary_from_circuit#

iqm.pulse.circuit_operations.get_unitary_from_circuit(circuit, table=None, qubit_names=None)#

Calculate the overall unitary implemented by a sequence of CircuitOperations.

Iterate through the list of operations, skipping over barrier operations, and calculate the unitary for each operation, and then calculate the matrix product of all of them. The unitary definition must be present in the QuantumOpTable given as the second argument.

Parameters:
  • circuit (list[CircuitOperation]) – list of CircuitOperations in order

  • table (dict[str, QuantumOp] | None) – Table of all registered quantum ops.

  • qubit_names (list[str] | None) – Optionally, the ordering of the qubits.

Returns:

Array describing the action of the circuit in big endian convention.

Return type:

ndarray