UnitaryCalculation
- braket.circuits.unitary_calculation.calculate_unitary_big_endian(instructions, qubits)[source]
Returns the unitary matrix representation for all the
instruction`s on qubits `qubits.Note
The performance of this method degrades with qubit count. It might be slow for
len(qubits)> 10.- Parameters:
instructions (Iterable[Instruction]) – The instructions for which the unitary matrix will be calculated.
qubits (QubitSet) – The actual qubits used by the instructions.
- Return type:
ndarray- Returns:
np.ndarray – A numpy array with shape (2^qubit_count, 2^qubit_count) representing the
instructionsas a unitary matrix.- Raises:
TypeError – If
instructionsis not composed only ofGateinstances, i.e. a circuit withNoiseoperators will raise this error. AnyCompilerDirectiveinstructions will be ignored, as these should not affect the unitary representation of the circuit.