题目描述
You are given a qubit in state $$| 0 \rangle$$ and an integer sign.
Your task is to convert the given qubit to state $${ \left| + \right\rangle } = { \frac { 1 } { \sqrt { 2 } } } ( { \left| 0 \right\rangle } + { \left| 1 \right\rangle } )$$ if sign = 1 or $${ \left| - \right\rangle } = { \frac { 1 } { \sqrt { 2 } } } ( { \left| 0 \right\rangle } - { \left| 1 \right\rangle } )$$ if sign = - 1.
Input
You have to implement an operation which takes a qubit and an integer as an input and has no output. The "output" of your solution is the state in which it left the input qubit.
Your code should have the following signature:
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分
样例输入
1
853963
样例输出
Test passed