<jupyter_start><jupyter_text>prepared by <NAME> (<EMAIL>) | November 07, 2018 I have some macros here. If there is a problem with displaying mathematical formulas, please run me to load these macros.$ \newcommand{\bra}[1]{\langle 1|} $$ \newcommand{\ket}[1]{|1\rangle} $$ \newcommand{\braket}[2]{\langle 1|2\rangle} $$ \newcommand{\inner}[2]{\langle 1,2\rangle} $$ \newcommand{\biginner}[2]{\left\langle 1,2\right\rangle} $$ \newcommand{\mymatrix}[2]{\left( \begin{array}{1} 2\end{array} \right)} $$ \newcommand{\myvector}[1]{\mymatrix{c}{1}} $$ \newcommand{\myrvector}[1]{\mymatrix{r}{1}} $$ \newcommand{\mypar}[1]{\left( 1 \right)} $$ \newcommand{\mybigpar}[1]{ \Big( 1 \Big)} $$ \newcommand{\sqrttwo}{\frac{1}{\sqrt{2}}} $$ \newcommand{\dsqrttwo}{\dfrac{1}{\sqrt{2}}} $$ \newcommand{\onehalf}{\frac{1}{2}} $$ \newcommand{\donehalf}{\dfrac{1}{2}} $$ \newcommand{\hadamard}{ \mymatrix{rr}{ \sqrttwo & \sqrttwo \\ \sqrttwo & -\sqrttwo }} $$ \newcommand{\vzero}{\myvector{1\\0}} $$ \newcommand{\vone}{\myvector{0\\1}} $$ \newcommand{\vhadamardzero}{\myvector{ \sqrttwo \\  \sqrttwo } } $$ \newcommand{\vhadamardone}{ \myrvector{ \sqrttwo \\ -\sqrttwo } } $$ \newcommand{\myarray}[2]{ \begin{array}{1}2\end{array}} $$ \newcommand{\X}{ \mymatrix{cc}{0 & 1 \\ 1 & 0}  } $$ \newcommand{\Z}{ \mymatrix{rr}{1 & 0 \\ 0 & -1}  } $$ \newcommand{\Htwo}{ \mymatrix{rrrr}{ \frac{1}{2} & \frac{1}{2} & \frac{1}{2} & \frac{1}{2} \\ \frac{1}{2} & -\frac{1}{2} & \frac{1}{2} & -\frac{1}{2} \\ \frac{1}{2} & \frac{1}{2} & -\frac{1}{2} & -\frac{1}{2} \\ \frac{1}{2} & -\frac{1}{2} & -\frac{1}{2} & \frac{1}{2} } } $$ \newcommand{\CNOT}{ \mymatrix{cccc}{1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0} } $$ \newcommand{\norm}[1]{ \left\lVert 1 \right\rVert } $ One QubitA qubit (quantum bit) has two states: state 0 and state 1.They are denoted by ket-notation:$ \ket{0} $ and $ \ket{1} $.We can show them as vectors:$ \ket{0} = \myvector{1 \\ 0} $ and $ \ket{1} = \myvector{0\\ 1} $.  NOT operator NOT operator flips the value of a qubit.We use capital letter for the matrix form of the operators:$ X = \X$. A technical note: Why is NOT operator referred as x-gate?   In Bronze, we use only real numbers, but we should note that complex numbers are also used in quantum computing.     When complex numbers are used, a qubit can be represented by a four dimensional real number valued vector, which is not possible to visualize.On the other hand, it is still possible to represent a qubit (with complex numbers) equivalently in three dimensions. This representation is called Bloch sphere. In three dimentions, we have axis: x, y, and z. X refers to the rotation with respect to x-axis.Similarly, we have the rotation with respect to y-axis and z-axis.In Bronze, we will also see the operator Z (z-gate).The operator Y is defined with complex numbers. The action of $ X $ on the qubit:$ X \ket{0} = \ket{1} $. More explicitly, $ X \ket{0} = \X \vzero = \vone = \ket{1} $.Similarly, $ X \ket{1} = \ket{0} $.More explicitly, $ X \ket{1} = \X \vone = \vzero = \ket{0} $.  Hadamard operatorHadamard operator ($ H $ or h-gate) looks like a fair coin-flipping.$$    H = \hadamard.$$But, there are certain dissimilarities:     we have a negative entry, and     instead of $ \frac{1}{2} $, we have its square root $ \mypar{ \frac{1}{\sqrt{2}} } $.  Quantum systems can have negative transitions. Probabilistic system with negative values. How can this be possible?    One-step HadamardLet's start in $ \ket{0} $.After applying $ H $:$$    \vhadamardzero = \hadamard \vzero = H \ket{0}.$$After measurement, we observe the zero and one states with equal probability $ \frac{1}{2} $. How can this be possible when their values are $ \frac{1}{\sqrt{2}} $? Let's start in $ \ket{1} $.After applying $ H $:$$    \vhadamardone = \hadamard \vone = H \ket{1}.$$After measurement, we observe the zero and one states with equal probability $ \frac{1}{2} $. We obtain the same values even when one of the value is negative.  The absolute value of a negative value is positive.The square of a negative value is also positive.As we have observed, the second fact would help to read the measurement results. When a quantum system is measured, the probability of observing one state is the sqaure of its value.In order to distinguish the value of a state to be in from the probability of a state to be observed, the value of a state to be in is called its amplitude.In the above example, the amplitude of the zero and one states are respectively $ \sqrttwo $ and $ -\sqrttwo $.Their probabilities to be observed after measurement are $ \onehalf $.  Task 1 What are the probabilities of observing the states  $ \ket{0} $ and $ \ket{1} $ if our system is in $ \myvector{-\frac{3}{5} \\ - \frac{4}{5}} $ or $ \myvector{\frac{3}{5} \\ \frac{4}{5}} $ or $ \myrvector{\frac{1}{\sqrt{3}} \\ - \frac{\sqrt{2}}{\sqrt{3}}} $?<jupyter_code>#
# you may use python  
#<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17543859649122806, 'fraction_numerical': 0.030248033877797943, 'mean_word_length': 3.7784200385356455, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '165334', 'license': 'Apache-2.0', 'n_tokens_mistral': 1691, 'n_tokens_neox': 1575, 'n_words': 586, 'path': 'community/awards/teach_me_quantum_2018/bronze/bronze/B44_One_Qubit.ipynb', 'repo_name': 'Chibikuri/qiskit-tutorials', 'size': '4975'}