Problem Statement
You are given an integer . Implement the operation defined by the following matrix on a quantum circuit with qubits:
where denotes the identity matrix.
Constraints
- Global phase is ignored in judge.
- The submitted code must follow the specified format:
Sample Input
- : The matrix is calculated as follows.
Hints
Open
- An -qubit quantum state can be represented as a column vector of size , just like a -qubit quantum state, and the adjoint , inner product , and outer product can also be defined in the same way.
- In the case of qubits, the identity matrix can be transformed as follows.