题目描述
You are given two qubits in state $${\left|00\right\rangle}$$ and an integer index. Your task is to create one of the Bell states on them according to the index:
- $${ \left| B_{ 0 } \right\rangle } = { \frac { 1 } { \sqrt { 2 } } } ( { \left| 0 0 \right\rangle } + { \left| 1 1 \right\rangle } )$$
- $${ \left| B _ { 1 } \right\rangle } = { \frac { 1 } { \sqrt { 2 } } } ( { \left| 0 0 \right\rangle } - { \left| 1 1 \right\rangle } )$$
- $${ \left| B_{ 2 } \right\rangle } = { \frac { 1 } { \sqrt { 2 } } } ( { \left| 0 1 \right\rangle } + { \left| 1 0 \right\rangle } )$$
- $${ \left| B_{ 3 } \right\rangle } = { \frac { 1 } { \sqrt { 2 } } } ( { \left| 0 1 \right\rangle } - { \left| 1 0 \right\rangle } )$$
Input
You have to implement an operation which takes an array of 2 qubits and an integer as an input and has no output. The "output" of your solution is the state in which it left the input qubits.
Your code should have the following signature:
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分
样例输入
0
567823
样例输出
Test passed