iqm.pulse.circuit_operations.reshape_unitary

iqm.pulse.circuit_operations.reshape_unitary#

iqm.pulse.circuit_operations.reshape_unitary(unitary, indices, n_qubits)#

Extend a unitary propagator to act on a larger system.

Given a unitary matrix acting on N qubits, indices of N qubits in a larger Hilbert space, and the number of qubits in that Hilbert space, calculate a unitary acting on the larger Hilbert space, which acts as the given unitary on the N selected qubits and as identity on the others.

Parameters:
  • unitary (tuple[tuple[float, ...], ...]) – original unitary as a nested tuple for hashing & caching purposes.

  • indices (tuple[int, ...]) – qubit indices in the larger Hilbert space, all in range(num_qubits)

  • n_qubits (int) – number of qubits in the larger Hilbert space

Returns:

Unitary matrix acting as unitary on the selected qubits in the larger Hilbert space.

Return type:

ndarray