<?xml version="1.0"?>
<Item id="X-SM381_1" TextType="CompleteItem" SchemaVersion="2.0" PageStartNumber="0" Template="Generic_A4_Unnumbered" DiscussionAlias="Discussion" SecondColour="None" ThirdColour="None" FourthColour="None" Logo="colour" Rendering="OpenLearn" x_oucontentversion="2025021001"><meta name="aaaf:olink_server" content="http://www.open.edu/openlearn/ocw"/><meta name="vle:osep" content="false"/><meta name="equations" content="mathjax"/><!--ADD CORRECT OPENLEARN COURSE URL HERE:<meta name="dc:source" content="http://www.open.edu/openlearn/education/educational-technology-and-practice/educational-practice/english-grammar-context/content-section-0"/>--><CourseCode>SM380_1</CourseCode><CourseTitle/><ItemID><!--leave blank--></ItemID><ItemTitle>Introduction to quantum computing</ItemTitle><FrontMatter><Imprint><Standard><GeneralInfo><Paragraph><b>About this free course</b></Paragraph><Paragraph>This free course is an adapted extract from the Open University course SM380 <i>Quantum physics: fundamentals and applications</i> <a href="https://www.open.ac.uk/courses/modules/sm380?utm_source=google&amp;utm_campaign=ou&amp;utm_medium=ebook">https://www.open.ac.uk/courses/modules/sm380</a><!--[MODULE code] [Module title- Italics] THEN LINK to Study @ OU page for module. Text to be page URL without http;// but make sure href includes http:// (e.g. <a href="http://www3.open.ac.uk/study/undergraduate/course/b190.htm">www3.open.ac.uk/study/undergraduate/course/b190?LKCAMPAIGN=ebook_&amp;amp;MEDIA=ou</a>)] -->.</Paragraph><Paragraph>This version of the content may include video, images and interactive content that may not be optimised for your device. </Paragraph><Paragraph>You can experience this free course as it was originally designed on OpenLearn, the home of free learning from The Open University &#x2013; <a href="https://www.open.edu/openlearn/science-maths-technology/introduction-quantum-computing/content-section-0?active-tab=description-tab?utm_source=openlearn&amp;utm_campaign=ol&amp;utm_medium=ebook">www.open.edu/openlearn/science-maths-technology/introduction-quantum-computing/content-section-0</a></Paragraph><!--[course name] hyperlink to page URL make sure href includes http:// with trackingcode added <Paragraph><a href="http://www.open.edu/openlearn/money-management/introduction-bookkeeping-and-accounting/content-section-0?LKCAMPAIGN=ebook_&amp;amp;MEDIA=ol">www.open.edu/openlearn/money-management/introduction-bookkeeping-and-accounting/content-section-0</a>. </Paragraph>--><Paragraph>There you&#x2019;ll also be able to track your progress via your activity record, which you can use to demonstrate your learning.</Paragraph></GeneralInfo><Address><AddressLine/><AddressLine/></Address><FirstPublished><Paragraph>First published 2025.</Paragraph></FirstPublished><Copyright><Paragraph>Unless otherwise stated, copyright &#xA9; 2025 The Open University, all rights reserved.</Paragraph></Copyright><Rights><Paragraph/><Paragraph><b>Intellectual property</b></Paragraph><Paragraph>Unless otherwise stated, this resource is released under the terms of the Creative Commons Licence v4.0 <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en">http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en</a>. Within that The Open University interprets this licence in the following way: <a href="http://www.open.edu/openlearn/about-openlearn/frequently-asked-questions-on-openlearn">www.open.edu/openlearn/about-openlearn/frequently-asked-questions-on-openlearn</a>. Copyright and rights falling outside the terms of the Creative Commons Licence are retained or controlled by The Open University. Please read the full text before using any of the content. </Paragraph><Paragraph>We believe the primary barrier to accessing high-quality educational experiences is cost, which is why we aim to publish as much free content as possible under an open licence. If it proves difficult to release content under our preferred Creative Commons licence (e.g. because we can&#x2019;t afford or gain the clearances or find suitable alternatives), we will still release the materials for free under a personal end-user licence. </Paragraph><Paragraph>This is because the learning experience will always be the same high quality offering and that should always be seen as positive &#x2013; even if at times the licensing is different to Creative Commons. </Paragraph><Paragraph>When using the content you must attribute us (The Open University) (the OU) and any identified author in accordance with the terms of the Creative Commons Licence.</Paragraph><Paragraph>The Acknowledgements section is used to list, amongst other things, third party (Proprietary), licensed content which is not subject to Creative Commons licensing.&#xA0;Proprietary content must be used (retained) intact and in context to the content at all times.</Paragraph><Paragraph>The Acknowledgements section&#xA0;is also used to bring to your attention any other Special Restrictions which may apply to the content.&#xA0;For example there may be times when the Creative Commons Non-Commercial Sharealike licence does not apply to any of the content even if owned by us (The Open University).&#xA0;In these instances, unless stated otherwise, the content may be used for personal and non-commercial use.</Paragraph><Paragraph>We have also identified as Proprietary other material included in the content which is not subject to Creative Commons Licence.&#xA0;These are OU logos, trading names and may extend to certain photographic and video images and sound recordings and any other material as may be brought to your attention.</Paragraph><Paragraph>Unauthorised use of any of the content may constitute a breach of the terms and conditions and/or intellectual property laws.</Paragraph><Paragraph>We reserve the right to alter, amend or bring to an end any terms and conditions provided here without notice.</Paragraph><Paragraph>All rights falling outside the terms of the Creative Commons licence are retained or controlled by The Open University.</Paragraph><Paragraph>Head of Intellectual Property, The Open University</Paragraph></Rights><Edited><Paragraph/></Edited><Printed><Paragraph/></Printed><ISBN><!--INSERT EPUB ISBN WHEN AVAILABLE (.kdl)-->
        <!--INSERT KDL ISBN WHEN AVAILABLE (.epub)--></ISBN><Edition/></Standard></Imprint><Covers><Cover template="false" type="ebook" src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/ol_ebook_generic_google_w1400xh2240.jpg"/><Cover template="false" type="A4" src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/ol_generic_PDF_A4_image_w2244x1488.jpg"/></Covers></FrontMatter><Unit><UnitID><!--leave blank--></UnitID><UnitTitle><!--leave blank--></UnitTitle><Session id="nonumber-id1"><Title>Introduction</Title><Paragraph>Quantum computing is a rapidly evolving field at the intersection of physics, mathematics, and computer science. Unlike classical computing, which relies on bits as units of information, quantum computing leverages the principles of quantum mechanics &#x2013; such as superposition and entanglement &#x2013; to solve certain computational problems more efficiently.</Paragraph><Paragraph>This course begins with an introduction to the basics of  &#x2018;classical&#x2019; computing, providing a foundation of logic gates and information processing before moving on to quantum computing. You will explore the fundamental principles of quantum computing and be introduced to the <GlossaryTerm>qubit</GlossaryTerm> (quantum-bit, pronounced <i>kew-bit</i>), the quantum analogue of the classical bit. </Paragraph><Paragraph>You will examine quantum computing processes, from input to output, including <GlossaryTerm>single-qubit gates</GlossaryTerm> and <GlossaryTerm>two-qubit gates</GlossaryTerm>. By the end of this section, you will be able to read a <GlossaryTerm>quantum circuit</GlossaryTerm>, predicting how a series of gates transforms input qubits into output states. Additionally, you will engage in activities, such as designing your own quantum circuit to achieve a specific computational outcome.</Paragraph><Paragraph>To ensure you have the necessary technical background, the course includes dedicated sections on relevant quantum physics and mathematics topics. Whether these sections serve as a review or introduce new concepts, they provide the foundation for grasping quantum computing. Essential concept to pay close attention to are <GlossaryTerm>quantum superposition</GlossaryTerm> and  <GlossaryTerm>quantum entanglement</GlossaryTerm>, two of the most fascinating and fundamental phenomena in quantum mechanics.</Paragraph><Paragraph>Finally, the course concludes with an overview of the technologies driving real-world quantum computing, exploring how researchers and companies are working to make quantum computers a reality.</Paragraph><Paragraph>By the end of this course, you will have a grasp of quantum computing fundamentals, its computational advantages, and the technological advancements shaping its future.</Paragraph><Paragraph>This OpenLearn course is an adapted extract from the Open University course <a href="https://www.open.ac.uk/courses/modules/sm380">SM380 <i>Quantum physics: fundamentals and applications</i></a>.</Paragraph><InternalSection/></Session><Session id="nonumber-id2"><Title>Learning outcomes</Title><Paragraph>After studying this course, you should be able to:</Paragraph><BulletedList><ListItem>describe a qubit and understand how it differs from a bit in classical computing</ListItem><ListItem>explain how a two-qubit CNOT gate can generate entanglement between two qubits</ListItem><ListItem>derive the output qubits of a quantum circuit given the input qubits </ListItem><ListItem>describe different ways quantum computing is being implemented in practice.</ListItem></BulletedList></Session><Session id="nonumber-id3"><Title>1 Why quantum computing?</Title><Paragraph>Quantum computers have the potential to revolutionize science and technology by overcoming the limitations of classical computing. Classical computers are limited by processing speed and computational resources so complex problems quickly become impossible to solve. Quantum computers can solve some computational problems significantly faster. This enhanced processing capability enables quantum computing to tackle complex problems more efficiently and unlock new types of applications. In this section, you will explore how quantum computers may outperform classical computers and drive innovation in various fields.</Paragraph><Section id="nonumber-id4"><Title>1.1 What can classical computers do?</Title><Paragraph>In this course, the term classical computers is used to refer to computers which use bits to encode information and carry out computations; i.e. they are binary based.</Paragraph><Paragraph>The complexity of tasks that any computer can complete is limited by the available time and computing resources. There are two routes to increasing the power of classical computing: one is to improve the hardware, which means increasing the size of the memory, the number of gates on a processor chip, or improving the speed of those elements. The other approach seeks to improve the software, i.e. the algorithms. </Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_ol_classic_com_section1_1.tif.jpg" x_folderhash="5377dda1" x_contenthash="2bb6fff6" x_imagesrc="sm380_ol_classic_com_section1_1.tif.jpg" x_imagewidth="512" x_imageheight="378"/><Caption><b>Figure 1</b> A classical computer</Caption><Description>A picture of a laptop on a desk. There is a plant to the right of the laptop and a lamp positioned behind. In the back ground is a bookcase.</Description></Figure><Paragraph>Thinking about the hardware, the improvement in computing power over the past 50 years has been enormous. The number of transistors on a microprocessor chip has doubled approximately every two years, a fact known as Moore&#x2019;s law. Unfortunately, this trend cannot continue indefinitely, because one of the main ways that these improvements are realised is by shrinking the size of the circuit elements.</Paragraph><Paragraph>Improving the algorithms is the second possibility. The power of an algorithm can be expressed by stating how the &#x2018;run-time&#x2019; which is the number of steps required to implement the algorithm, scales with the size of the task. Some algorithms have a polynomial run-time meaning that if a procedure is to be carried out on a number, <i>n</i>, of elements,  the run-time scales as <i>n<sup>x</sup></i> where <i>x</i> is typically a small integer. Other algorithms have an exponential run-time, scaling as e<sup><i>n</i></sup>.</Paragraph><Paragraph>The algorithms with polynomial run-time are considered to be much more useful than algorithms with exponential run-time, because exponential scaling means that only modest increases in the task size can exhaust available resources. </Paragraph><Box><Paragraph>Throughout this course there are a series of exercises for you to work through. Some of these exercises you can supply your answer to in the response boxes provided. Others will require you to work through your calculations on paper.</Paragraph></Box><Exercise><Heading>Exercise 1</Heading><Question><Paragraph>Consider some algorithms that are carried out on two data sets &#x2013; one with <i>n</i> = 10 elements and another with <i>n</i> = 100 elements.  The run-time of one algorithm scales as <i>n</i><sup>3</sup> and the run-time of another algorithm scales as e<sup><i>n</i></sup>. How do the run-times of the two algorithms compare for the smaller data set? How do the run-times compare for the larger data set?</Paragraph></Question><Answer><Paragraph>For the smaller data set, the run-times for the two algorithms are in the ratio <InlineEquation><TeX>\rm{e}^{10} / 10^3 \sim 22</TeX></InlineEquation>, whereas for the larger data set, the run-times for the two algorithms are in the ratio <InlineEquation><TeX>\rm{e}^{100} / 100^3 \sim 2.7 \times 10^{37}</TeX></InlineEquation>. The time to carry out the algorithm with the exponential run-time soon becomes unfeasibly long as the size of the data set increases.</Paragraph></Answer></Exercise></Section><Section id="nonumber-id5"><Title>1.2 What can quantum computers do?</Title><Paragraph>Quantum computing offers a new computing approach that is based on the idea that the rules of quantum mechanics can allow shortcuts to solutions for certain tasks. There are quantum algorithms with polynomial run-times that can solve problems where the only known classical algorithms have exponential run-times. Quantum computers make use of the fact that quantum states can be made of linear combinations of individual states and when a measurement is taken, one of the individual states will be measured with a given probability. You will see that entanglement is another fundamental resource for quantum computing. </Paragraph><Paragraph>The <GlossaryTerm>integer factorisation problem</GlossaryTerm>, which seeks to find the prime number factors of an <i>n</i>-digit integer, is of particular interest because it is the basis of a lot of information security.  The run-time of the classical algorithm scales exponentially so as <i>n</i> increases a classical computer takes longer and longer to factorise the integers as <i>n</i> increases. The integer factorisation problem is an example of a a problem that quantum computers can solve much more efficiently. If quantum computing was able to solve the integer factorisation problem with a polynomial run-time then there would be a major problem for information security. </Paragraph><Paragraph>Another example of a problem with an exponential run-time is the <GlossaryTerm>travelling salesperson problem</GlossaryTerm>, which seeks to find the shortest route between a number of cities subject to visiting each city only once and returning to the starting city at the end of the journey (see Figure 2). This is a typical <GlossaryTerm>optimisation</GlossaryTerm> problem which can be used to demonstrate the power of quantum computing as well as being a problem which delivery companies would like to be able to solve quickly.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/travelling.gif" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/travelling.gif" width="100%" x_folderhash="865a0355" x_contenthash="12b4648e" x_imagesrc="travelling.gif" x_imagewidth="650" x_imageheight="294"/><Caption><b>Figure 2</b> An illustration of the travelling salesperson problem. The image on the left shows 7 cities (in blue) and a trial of all 360 possible routes between them (in red). The image on the right shows the optimum distance after trialling all possible routes. </Caption><Description><Paragraph>The image on the left shows shows 7 blue dots in a grid with red lines connecting them. The red lines change position as different connections are trialled. The image on the right shows the same 7 blue dots with a green line connecting the shortest possible distance between them.</Paragraph></Description></Figure><Exercise><Heading>Exercise 2</Heading><Question><Paragraph>Write a sentence or two to summarise in general terms the context in which quantum computers are considered to be an improvement on classical computers.</Paragraph></Question><Interaction><FreeResponse size="paragraph" id="e2"/></Interaction><Answer><Paragraph>Your answer will not be the same but a possible answer is:</Paragraph><Paragraph>Quantum computers may be able solve some problems more quickly than classical computers if problem solving algorithms which have exponential run-times on a classical computer can be written to have polynomial run-times on a quantum computer.</Paragraph><Paragraph>Your answer should include the same conclusions.</Paragraph></Answer></Exercise></Section></Session><Session id="nonumber-id6"><Title>2 Background mathematics and terminology</Title><Paragraph>In this section, some mathematics and terminology which will be needed to learn about quantum computing are introduced. This includes matrices, eigenvalue equations and complex numbers.</Paragraph><Section id="nonumber-id7"><Title>2.1 Matrix multiplication</Title><Paragraph>A <GlossaryTerm>matrix</GlossaryTerm>, <InlineEquation><TeX>\mathrm{A}</TeX></InlineEquation>, is a rectangular array of numbers arranged in rows and columns. (Matrices is the plural of the word matrix.) You will concentrate on two-dimensional situations, and so consider matrices of the form:</Paragraph><Paragraph/><Equation><TeX>\begin{bmatrix} {A_{11}} &amp; {A_{12}} \\ {A_{21}} &amp; {A_{22}} \end{bmatrix} \quad \quad 2 \times 2 \; \text{square matrix}</TeX></Equation><Equation><TeX>\begin{bmatrix} {A_{11}} &amp; {A_{12}} \end{bmatrix} \quad \quad 1 \times 2 \; \text{row matrix}</TeX></Equation><Equation><TeX>\begin{bmatrix} {A_{11}} \\ {A_{21}} \end{bmatrix} \quad \quad 2 \times 1 \; \text{column matrix}</TeX></Equation><Paragraph>In order to multiply two matrices, the number of columns of first matrix should be equal to the number of rows in the second matrix. Matrices of the right shape can be multiplied together as follows:</Paragraph><Equation><TeX>  \mathrm{C} = \mathrm{A} \mathrm{B}.</TeX><Label>(1)</Label></Equation><Paragraph>To calculate <InlineEquation><TeX>\mathrm{C}</TeX></InlineEquation>, where <InlineEquation><TeX>\mathrm{C}_{ij}</TeX></InlineEquation> is the element in the <i>i</i> th row and <i>j</i> th column of <InlineEquation><TeX>\mathrm{C}</TeX></InlineEquation>, you go along the <InlineEquation><TeX>i</TeX></InlineEquation>th row of <InlineEquation><TeX>\mathrm{A}</TeX></InlineEquation> and down the <InlineEquation><TeX>j</TeX></InlineEquation>th column of <InlineEquation><TeX>\mathrm{B}</TeX></InlineEquation>, multiplying corresponding elements and adding the results. For two <InlineEquation><TeX>2 \times 2</TeX></InlineEquation> matrices, this pattern may be visualized as follows:</Paragraph><Equation><TeX>\begin{bmatrix}{*}&amp;{\phantom{xx}}\\{}&amp;{} \end{bmatrix} =
 \begin{bmatrix}{\rightarrow}&amp; {\rightarrow}\\ {}&amp; {} \end{bmatrix} \begin{bmatrix}{\downarrow}&amp;{\phantom{xx}}\\{\downarrow}&amp;{}\end{bmatrix}</TeX></Equation><Equation><TeX>\begin{bmatrix}{\phantom{xx}}&amp;{*}\\{}&amp;{}\end{bmatrix}  =
  \begin{bmatrix} {\rightarrow}&amp;{\rightarrow}\\{}&amp;{}\end{bmatrix} \begin{bmatrix} {\phantom{xx}}&amp;{\downarrow}\\{}&amp;{\downarrow}\end{bmatrix}</TeX></Equation><Equation><TeX> \begin{bmatrix}{}&amp;{}\\{*}&amp;{\phantom{xx}}\end{bmatrix}  =
\begin{bmatrix}{}&amp;{}\\{\rightarrow}&amp;{\rightarrow}\end{bmatrix} \begin{bmatrix}{\downarrow}&amp;{\phantom{xx}}\\{\downarrow}&amp;{}\end{bmatrix}</TeX></Equation><Equation><TeX>\begin{bmatrix}{}&amp;{}\\{\phantom{xx}}&amp;{*}\end{bmatrix}  =
\begin{bmatrix}{}&amp;{}\\{\rightarrow}&amp;{\rightarrow} \end{bmatrix} \begin{bmatrix}{}&amp;{\downarrow}\\{\phantom{xx}}&amp;{\downarrow} \end{bmatrix}</TeX></Equation><Paragraph>where the <InlineEquation><TeX>*</TeX></InlineEquation> indicates a matrix element in the new matrix, <InlineEquation><TeX>\mathrm{C}</TeX></InlineEquation>, and the arrows show how matrix elements in the old matrices are processed to obtain this. In order to multiply two matrices, the number of columns of first matrix should be equal to the number of rows in the second matrix. In other words, each term <InlineEquation><TeX>C_{ij}</TeX></InlineEquation> is given by <InlineEquation><TeX>C_{ij} = A_{i1}B_{1j} + A_{i2}B_{2j}</TeX></InlineEquation>.</Paragraph><Exercise><Heading>Exercise 3</Heading><Question><NumberedList class="lower-alpha"><ListItem><Paragraph>What shape is the result of multiplying a <InlineEquation><TeX>1 \times 2</TeX></InlineEquation> row matrix by a <InlineEquation><TeX>2 \times 2</TeX></InlineEquation> square matrix?</Paragraph></ListItem><ListItem><Paragraph>What shape is the result of multiplying a <InlineEquation><TeX>2 \times 2</TeX></InlineEquation> square matrix by a <InlineEquation><TeX>1 \times 2</TeX></InlineEquation> row matrix?</Paragraph></ListItem><ListItem><Paragraph>What shape is the result of multiplying a <InlineEquation><TeX>2 \times 2</TeX></InlineEquation> square matrix by a <InlineEquation><TeX>2 \times 1</TeX></InlineEquation> column matrix?</Paragraph></ListItem><ListItem><Paragraph>What shape is the result of multiplying a <InlineEquation><TeX>1 \times 2</TeX></InlineEquation> row matrix by a <InlineEquation><TeX>2 \times 1</TeX></InlineEquation> column matrix?</Paragraph></ListItem></NumberedList></Question><Interaction><FreeResponse size="paragraph" id="e3"/></Interaction><Answer><NumberedList class="lower-alpha"><ListItem><Paragraph>The result is a <InlineEquation><TeX>1 \times 2</TeX></InlineEquation> row matrix.</Paragraph></ListItem><ListItem>This operation cannot be performed because  the number of columns of first matrix is not equal to the number of rows in the second matrix.</ListItem><ListItem><Paragraph>The result is a <InlineEquation><TeX>2 \times 1</TeX></InlineEquation> column matrix.</Paragraph> </ListItem><ListItem><Paragraph>The result is a <InlineEquation><TeX>1 \times 1</TeX></InlineEquation> matrix (i.e. a scalar number).</Paragraph> </ListItem></NumberedList></Answer></Exercise><Exercise><Heading>Exercise 4</Heading><Question><Paragraph>Evaluate the following combination of square matrices:</Paragraph><Equation><TeX>\begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix}</TeX></Equation></Question><Answer><Paragraph>The product of two matrices is given by:</Paragraph><Equation><TeX>\begin{bmatrix} A_{11} &amp; A_{12} \\ A_{21} &amp; A_{22} \end{bmatrix} \begin{bmatrix} B_{11} &amp; B_{12} \\ B_{21} &amp; B_{22} \end{bmatrix} = \begin{bmatrix} A_{11}B_{11} + A_{12}B_{21} &amp; A_{11}B_{12} + A_{12}B_{22} \\ A_{21}B_{11} + A_{22}B_{21} &amp; A_{21}B_{12} + A_{22} B_{22} \end{bmatrix}</TeX></Equation><Paragraph>So, to find the matrix element in row <InlineEquation><TeX>i</TeX></InlineEquation> and column <InlineEquation><TeX>j</TeX></InlineEquation> of the product <InlineEquation><TeX>\mathrm{AB}</TeX></InlineEquation>, we multiply the elements in row <InlineEquation><TeX>i</TeX></InlineEquation> of <InlineEquation><TeX>\mathrm{A}</TeX></InlineEquation> with the corresponding elements in column <InlineEquation><TeX>j</TeX></InlineEquation> of <InlineEquation><TeX>\mathrm{B}</TeX></InlineEquation>, and add the results together.
</Paragraph><Paragraph>To find the product of three matrices, <InlineEquation><TeX>\mathrm{ABC}</TeX></InlineEquation>, we first evaluate <InlineEquation><TeX>\mathrm{BC}</TeX></InlineEquation> and then form the product <InlineEquation><TeX>\mathrm{A(BC)}</TeX></InlineEquation>, taking care to preserve the order of the matrices.</Paragraph><Paragraph>So the solution is</Paragraph><Equation><TeX> \begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix}  = \begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 \times 1 + 0 \times 2 &amp; 1 \times 2 + 0 \times (-1) \\ 0 \times 1 + (-1) \times 2 &amp; 0 \times 2 + (-1) \times (-1) \end{bmatrix}</TeX></Equation><Equation><TeX>\begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix}  = \begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 2 \\ -2 &amp; 1 \end{bmatrix}</TeX></Equation><Equation><TeX>\begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix}  = \begin{bmatrix} 1 \times 1 + 2 \times (-2) &amp; 1 \times 2 + 2 \times 1 \\ 2 \times 1 + (-1) \times (-2) &amp; 2 \times 2 + (-1) \times 1 \end{bmatrix}</TeX></Equation><Equation><TeX>\begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 &amp; 2 \\ 2 &amp; -1 \end{bmatrix} = \begin{bmatrix} -3 &amp; 4 \\ 4 &amp; 3 \end{bmatrix}</TeX></Equation></Answer></Exercise></Section><Section id="nonumber-id8"><Title>2.2 Finding the eigenvalues and eigenvectors of a <InlineEquation><TeX>2 \times 2</TeX></InlineEquation> matrix</Title><Paragraph>For a given square matrix, <InlineEquation><TeX>\mathrm{A}</TeX></InlineEquation>, it is possible to solve the equation</Paragraph><Equation><TeX>  \mathrm{A}\mathbf{v}= \lambda \mathbf{v}  </TeX><Label>(2)</Label></Equation><Paragraph>where <InlineEquation><TeX>\mathbf{v}</TeX></InlineEquation> are column vectors known as <GlossaryTerm>eigenvectors</GlossaryTerm> and <InlineEquation><TeX>\lambda</TeX></InlineEquation> is a scalar called an <GlossaryTerm>eigenvalue</GlossaryTerm>.</Paragraph><Paragraph>A procedure to find the eigenvectors and eigenvalues of a <InlineEquation><TeX>2 \times 2</TeX></InlineEquation> square matrix <InlineEquation><TeX>\mathrm{A} = \begin{bmatrix}{a}&amp;{b}\\{c}&amp;{d}\end{bmatrix}</TeX></InlineEquation> is</Paragraph><BulletedList><ListItem><Paragraph>Solve the quadratic equation  <InlineEquation><TeX>\lambda^2-(a+d)\lambda+ (ad -bc)=0</TeX></InlineEquation> to find the two values of <InlineEquation><TeX>\lambda</TeX></InlineEquation> which are the required eigenvalues.</Paragraph></ListItem><ListItem><Paragraph>For each eigenvalue found, write down the eigenvector equations </Paragraph><Equation><TeX>(a-\lambda) x + by=0</TeX></Equation><Equation><TeX>cx + (d-\lambda)y=0</TeX></Equation></ListItem><ListItem><Paragraph>This pair of equations usually reduces to a single equation that is readily solved for <InlineEquation><TeX>x</TeX></InlineEquation> and <InlineEquation><TeX>y</TeX></InlineEquation>. The eigenvector is given by <InlineEquation><TeX>\mathbf{v} =\begin{bmatrix}{x}\\{y}\end{bmatrix}</TeX></InlineEquation> with <InlineEquation><TeX>x</TeX></InlineEquation> and <InlineEquation><TeX>y</TeX></InlineEquation> replaced by their solved values.</Paragraph></ListItem><ListItem><Paragraph>It is often useful to normalise <InlineEquation><TeX>\mathbf{v}</TeX></InlineEquation> by writing it as a unit vector. It this case, the unit vector is given by</Paragraph><Equation><TeX> \mathbf{v}_u = \frac{1}{\sqrt{x^2+y^2}} \begin{bmatrix}{x}\\{y} \end{bmatrix}.</TeX></Equation></ListItem></BulletedList><Exercise><Heading>Exercise 5</Heading><Question><Paragraph>Find the eigenvalues and eigenvectors of the following matrix:</Paragraph><Equation><TeX>\Lambda = \begin{bmatrix} 4 &amp; 1 \\ 2 &amp; 3 \end{bmatrix}</TeX></Equation></Question><Answer><Paragraph>Following the prescription described above: <InlineEquation><TeX>a=4</TeX></InlineEquation>, <InlineEquation><TeX>b=1</TeX></InlineEquation>, <InlineEquation><TeX>c=2</TeX></InlineEquation> and <InlineEquation><TeX>d=3</TeX></InlineEquation>. So we first need to solve the quadratic equation</Paragraph><Equation><TeX> \lambda^2 - (4+3) \lambda + ((4 \times 3) - (1 \times 2)) = 0</TeX></Equation><Paragraph>which is simply</Paragraph><Equation><TeX> \lambda^2 - 7 \lambda + 10 = 0</TeX></Equation><Paragraph>This can be written as</Paragraph><Equation><TeX> (\lambda - 2) (\lambda - 5) = 0</TeX></Equation><Paragraph>So it has solutions <InlineEquation><TeX>\lambda_1 = 2</TeX></InlineEquation> and <InlineEquation><TeX>\lambda_2 = 5</TeX></InlineEquation>. These are the two eigenvalues.</Paragraph><Paragraph>We now write the two eigenvector equations:</Paragraph><Equation><TeX>\begin{split}
    (4 - \lambda) x + 1y &amp; = 0 \\
    2x + (3 - \lambda)y &amp; = 0
\end{split}</TeX></Equation><Paragraph>For eigenvalue <InlineEquation><TeX>\lambda_1 = 2</TeX></InlineEquation> these reduce to
</Paragraph><Equation><TeX>
\begin{split}
    2x + y &amp; = 0 \\
    2x + y &amp; = 0
\end{split}</TeX></Equation><Paragraph>Both equations imply that <InlineEquation><TeX>y=-2x</TeX></InlineEquation>, so <InlineEquation><TeX>x=1</TeX></InlineEquation> and <InlineEquation><TeX>y=-2</TeX></InlineEquation> and the first eigenvector is </Paragraph><Equation><TeX>  \mathbf{v}_1 = \begin{bmatrix} 1 \\ -2 \end{bmatrix}</TeX></Equation><Paragraph>For eigenvalue <InlineEquation><TeX>\lambda_2 = 5</TeX></InlineEquation> these reduce to
</Paragraph><Equation><TeX>
\begin{split}
    -x + y &amp; = 0 \\
    2x - 2y &amp; = 0
\end{split}</TeX></Equation><Paragraph>Both equations imply that <InlineEquation><TeX>y=x</TeX></InlineEquation>, so <InlineEquation><TeX>x=1</TeX></InlineEquation> and <InlineEquation><TeX>y=1</TeX></InlineEquation> and the second eigenvector is </Paragraph><Equation><TeX>  \mathbf{v}_2 = \begin{bmatrix} 1 \\ 1 \end{bmatrix}</TeX></Equation></Answer></Exercise></Section><Section id="nonumber-id9"><Title>2.3 Complex numbers</Title><Paragraph>A <GlossaryTerm>complex number</GlossaryTerm> may be written in the form:</Paragraph><Equation><TeX>z = x +\textrm{i}y,</TeX><Label>(3)</Label></Equation><Paragraph>where <InlineEquation><TeX>x</TeX></InlineEquation> and <InlineEquation><TeX>y</TeX></InlineEquation> are real numbers and i is a special quantity with the property that <InlineEquation><TeX>\textrm{i}^2=-1</TeX></InlineEquation>.</Paragraph><Paragraph>Each complex number <InlineEquation><TeX>z = x +\textrm{i}y</TeX></InlineEquation> has a <GlossaryTerm>real part</GlossaryTerm>, Re<InlineEquation><TeX>\{z\} = x</TeX></InlineEquation>, and an <GlossaryTerm>imaginary part</GlossaryTerm>, Im<InlineEquation><TeX>\{z\}=y</TeX></InlineEquation>. </Paragraph><Paragraph>Complex numbers can be added,</Paragraph><Equation><TeX>(a+b\textrm{i}) + (c+d\textrm{i}) = (a+c) +(b+d)\textrm{i},</TeX></Equation><Paragraph>and multiplied, </Paragraph><Equation><TeX>(a+b\textrm{i})(c+d\textrm{i}) = (ac-bd) +(ad+bc)\textrm{i},</TeX></Equation><Paragraph>using the usual rules of algebra along with <InlineEquation><TeX>\textrm{i}^2=-1</TeX></InlineEquation>.</Paragraph><Paragraph>The <GlossaryTerm>complex conjugate</GlossaryTerm> of <InlineEquation><TeX>z = x +\textrm{i}y</TeX></InlineEquation> is <InlineEquation><TeX>z^* = x -\textrm{i}y</TeX></InlineEquation> (pronounced "z star").</Paragraph><Paragraph>This results in <InlineEquation><TeX>zz^* = (x +\textrm{i}y)(x -\textrm{i}y) = x^2 + y^2</TeX></InlineEquation> showing that <InlineEquation><TeX>zz^*</TeX></InlineEquation> is a positive real number, (unless <InlineEquation><TeX>x=y=0</TeX></InlineEquation>).</Paragraph><Paragraph>The <GlossaryTerm>modulus</GlossaryTerm> of the complex number <InlineEquation><TeX>z = x +\textrm{i}y</TeX></InlineEquation> is defined as </Paragraph><Equation><TeX>  |z| =\sqrt{zz^*} = \sqrt{x^2 + y^2} </TeX><Label>(4)</Label></Equation><Paragraph>which is a real, non-negative quantity.</Paragraph><Paragraph>Complex numbers can also be written in polar form,</Paragraph><Equation><TeX>z=r\text{e}^{\textrm{i}\theta},</TeX><Label>(5)</Label></Equation><Paragraph>where <InlineEquation><TeX>r</TeX></InlineEquation> and <InlineEquation><TeX>\theta</TeX></InlineEquation> are real numbers. The relationship between <InlineEquation><TeX>x</TeX></InlineEquation> and <InlineEquation><TeX>y</TeX></InlineEquation>, <InlineEquation><TeX>r</TeX></InlineEquation> and <InlineEquation><TeX>\theta</TeX></InlineEquation> is shown in Figure 3. Here <InlineEquation><TeX>r</TeX></InlineEquation> is the modulus of <InlineEquation><TeX>z</TeX></InlineEquation> as defined in Equation (4); <InlineEquation><TeX>\theta</TeX></InlineEquation> is known as the phase, and <InlineEquation><TeX>\textrm{e}^{\textrm{i}\theta}</TeX></InlineEquation> is a phase factor.
</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/polar_complex_number.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/polar_complex_number.png" width="100%" x_folderhash="865a0355" x_contenthash="993cc87d" x_imagesrc="polar_complex_number.png" x_imagewidth="201" x_imageheight="131"/><Caption><b>Figure 3</b> A diagram showing the relationship between Cartesian coordinates <InlineEquation><TeX>x</TeX></InlineEquation> and <InlineEquation><TeX>y</TeX></InlineEquation>, and polar coordinates <InlineEquation><TeX>r</TeX></InlineEquation> and <InlineEquation><TeX>\theta</TeX></InlineEquation></Caption><Description><Paragraph>The fighure shows a graph with two axes, labelled x-axis and y-axis, which intersect near the middle of the diagram, marked 0.  An arrow is drawn from the origin at 0 into the upper right quadrant of the graph. The length of the arrow is labelled r and the angle it makes with the horizontal x-axis is labelled theta. A horizontal dashed line from the end of this arrow intersects the y-axis at a point marked y. A vertical dashed line from the end of this arrow intersects the x-axis at a point marked x.</Paragraph></Description></Figure><Exercise><Heading>Exercise 6</Heading><Question><Paragraph>Consider the complex number <InlineEquation><TeX>z=3+3\mathrm{i}</TeX></InlineEquation>.
</Paragraph><NumberedList class="lower-alpha"><ListItem><Paragraph>Write down its complex conjugate <InlineEquation><TeX>z^*</TeX></InlineEquation>.
</Paragraph></ListItem><ListItem><Paragraph>Calculate the modulus of <InlineEquation><TeX>z</TeX></InlineEquation>.</Paragraph></ListItem><ListItem><Paragraph>Write <InlineEquation><TeX>z</TeX></InlineEquation> in polar form.</Paragraph></ListItem></NumberedList></Question><Answer><NumberedList class="lower-alpha"><ListItem><Paragraph>The complex conjugate is <InlineEquation><TeX>z^* = 3 - 3\mathrm{i}</TeX></InlineEquation>.</Paragraph></ListItem><ListItem><Paragraph>The modulus of <InlineEquation><TeX>z</TeX></InlineEquation> is</Paragraph><Equation><TeX>    |z| = \sqrt{z z^*} = \sqrt{3^2 + 3^2} = \sqrt{9+9} = \sqrt{18} = 3\sqrt{2}</TeX></Equation></ListItem><ListItem> <Paragraph>In polar form <InlineEquation><TeX>z=r \textrm{e}^{\textrm{i}\theta}</TeX></InlineEquation> where <InlineEquation><TeX>r=|z| = 3\sqrt{2}</TeX></InlineEquation> and <InlineEquation><TeX>\tan \theta = 3/3 = 1</TeX></InlineEquation>, so <InlineEquation><TeX>\theta = \pi/4</TeX></InlineEquation> radians. Therefore we can write <InlineEquation><TeX>z = 3\sqrt{2}\text{e}^{\text{i}\pi/4}</TeX></InlineEquation>.
</Paragraph></ListItem></NumberedList></Answer></Exercise></Section><Section id="nonumber-id10"><Title>2.4 Operators and superposition</Title><Paragraph>In quantum mechanics, an <GlossaryTerm>operator</GlossaryTerm> is a mathematical entity which converts one function into another function and is written with a &#x2018;hat&#x2019;on, for example <InlineEquation><TeX>\mathrm{\widehat{A}}</TeX></InlineEquation>, (pronounced &#x2018;A hat&#x2019;). Given an operator <InlineEquation><TeX>\mathrm{\widehat{A}}</TeX></InlineEquation>, the eigenvalue equation for that operator is</Paragraph><Equation><TeX>    \mathrm{\widehat{A}}f(x)= \lambda f(x)</TeX><Label>(6)</Label></Equation><Paragraph>Here, <InlineEquation><TeX>\lambda</TeX></InlineEquation> is a constant known as an eigenvalue, which may be complex, and <InlineEquation><TeX>f(x)</TeX></InlineEquation> is function known as an <GlossaryTerm>eigenfunction</GlossaryTerm>. There may be more than one eigenvalue and corresponding eigenfunction associated with each eigenvalue equation. The eigenvalue matrix equation, Equation (2) as described in Section 2.2 is an example of this type of equation with the operator written as a matrix and the eigenfunction as a column vector. </Paragraph><Paragraph>Consider an operator <InlineEquation><TeX>\mathrm{\widehat{A}}</TeX></InlineEquation> with two eigenvectors and two corresponding eigenvalues so that</Paragraph><Equation><TeX>\mathrm{\widehat{A}}f_1(x)= \lambda_1 f_1(x) \quad \text{and} \quad  \mathrm{\widehat{A}}f_2(x)= \lambda_2 f_2(x).</TeX></Equation><Paragraph>Since <InlineEquation><TeX>f_1(x)</TeX></InlineEquation> and <InlineEquation><TeX>f_2(x)</TeX></InlineEquation> are both eigenfunctions or solutions of the eigenvalue equation any linear combination of <InlineEquation><TeX>f_1(x)</TeX></InlineEquation> and <InlineEquation><TeX>f_2(x)</TeX></InlineEquation> is also a solution. Such a linear combination, known as a <GlossaryTerm>superposition</GlossaryTerm>, is</Paragraph><Equation><TeX>f(x) = a_1f_1(x) + a_2 f_2(x)</TeX></Equation><Paragraph>where <InlineEquation><TeX>a_1</TeX></InlineEquation> and <InlineEquation><TeX>a_2</TeX></InlineEquation> are complex numbers.</Paragraph><Exercise><Heading>Exercise 7</Heading><Question><Paragraph>The wave function of a free particle in quantum mechanics may be written as</Paragraph><Equation><TeX> \Psi_\text{free}(x,t) = A \text{e}^{\text{i}(kx - \omega t)}</TeX></Equation><Paragraph>Confirm that <InlineEquation><TeX>\Psi_\text{free}(x,t)</TeX></InlineEquation> is an eigenfunction of <InlineEquation><TeX>\text{i} \hbar \partial / \partial t</TeX></InlineEquation> (where <InlineEquation><TeX>\partial / \partial t</TeX></InlineEquation> indicates a partial derivative) and show that the eigenvalue is the energy of the free particle, <InlineEquation><TeX>\hbar \omega</TeX></InlineEquation>. (<InlineEquation><TeX>\hbar</TeX></InlineEquation> is the reduced Planck&#x2019;s constant.)</Paragraph></Question><Answer><Paragraph>Operating on <InlineEquation><TeX>\Psi_\text{free}(x,t)</TeX></InlineEquation> with <InlineEquation><TeX>\text{i} \hbar \partial / \partial t</TeX></InlineEquation> we find that</Paragraph><Equation><TeX>\begin{split}     \text{i} \hbar \frac{\partial}{\partial t} \Psi_\text{free} (x,t) &amp; =
     \text{i} \hbar \frac{\partial}{\partial t}\left( A \text{e}^{\text{i}(kx - \omega t)} \right) \\
    &amp; = - \hbar \omega A \text{i}^2 \text{e}^{\text{i}(kx - \omega t)} \\
    &amp; = \hbar \omega \Psi_\text{free}(x,t) \end{split}
</TeX></Equation><Paragraph>Thus the free-particle wave function <InlineEquation><TeX>\Psi_\text{free}(x,t) = A \text{e}^{\text{i}(kx - \omega t)}</TeX></InlineEquation> is an eigenfunction of <InlineEquation><TeX>\text{i} \hbar \partial / \partial t</TeX></InlineEquation> and the corresponding eigenvalue is the energy, <InlineEquation><TeX>\hbar \omega</TeX></InlineEquation>, associated with this wave.
</Paragraph></Answer></Exercise></Section></Session><Session id="nonumber-id11"><Title>3 Setting the scene in quantum physics</Title><Paragraph>In this section, some quantum physics needed to study quantum computing is introduced. You will learn about <GlossaryTerm>spin-&#xBD; particles</GlossaryTerm>, which have two fundamental <GlossaryTerm>basis states</GlossaryTerm> but can also exist in a superposition of these states. This concept is central to quantum mechanics and directly relates to quantum computing, where quantum bits (qubits) similarly have two basis states and can exist in any <i>superpositions</i> of these two states.  In the context of spin-&#xBD;  particles the two states are called <GlossaryTerm>spin-up</GlossaryTerm> and <GlossaryTerm>spin-down</GlossaryTerm>; in quantum computing the two states are referred to as <GlossaryTerm>logical states</GlossaryTerm>. At the end of this section, the essential concept for quantum computing of entanglement is illustrated using spin-states. 
</Paragraph><Section id="nonumber-id12"><Title>3.1 Spin-&#xBD;  particles</Title><Paragraph>Experiments show that electrons have an intrinsic property which is called <GlossaryTerm>spin</GlossaryTerm>. (Mass and charge are other examples of intrinsic properties of particles.) Spin is a type of angular momentum with a quantum number of &#xBD; which means that a measurement of spin along an axis can only have values of <InlineEquation><TeX>+\hbar/2</TeX></InlineEquation> or <InlineEquation><TeX>-\hbar/2</TeX></InlineEquation> as an outcome. (Here <InlineEquation><TeX>\hbar = h/2 \pi</TeX></InlineEquation> where <i>h</i> is Planck&#x2019;s constant, 6.626 &#xD7; 10<sup>-34</sup> J s.) Thus, electrons are referred to as spin-&#xBD; particles. </Paragraph><Paragraph>The most important spin operators are the component of spin angular momentum in the <i>z</i>-direction, <InlineEquation><TeX>\mathrm{\widehat{S}}_z</TeX></InlineEquation> and the total spin angular momentum, <InlineEquation><TeX>\mathrm{\widehat{S}^2}</TeX></InlineEquation>. The eigenvalue equations for these operators are </Paragraph><Equation><TeX>\begin{align*}
        \mathrm{\widehat{S}}^2 |  S,M_\text{s} \rangle &amp; = S(S+1) \, \hbar^2 \,  | S,M_\text{s} \rangle, \\
        \mathrm{\widehat{S}}_z | S,M_\text{s} \rangle &amp; = M_\text{s} \, \hbar \, |S,M_\text{s} \rangle.     
\end{align*}  </TeX></Equation><Paragraph>where the angled bracket, <InlineEquation><TeX>| ~~ \rangle</TeX></InlineEquation> is used and is called a <GlossaryTerm>ket</GlossaryTerm>.  <InlineEquation><TeX>| S, M_\text{s} \rangle</TeX></InlineEquation> represents the eigenfunction, known as an <GlossaryTerm>eigenstate</GlossaryTerm> with a spin quantum number of <InlineEquation><TeX>S</TeX></InlineEquation> and a spin magnetic quantum number of <InlineEquation><TeX>M_\text{s}</TeX></InlineEquation>. For a single electron <InlineEquation><TeX>S=\frac{1}{2}</TeX></InlineEquation> and <InlineEquation><TeX>M_\text{s}=\pm \frac{1}{2}</TeX></InlineEquation>. The state with <InlineEquation>
<TeX>M_\text{s}=+\frac{1}{2}</TeX></InlineEquation> is the spin-up state and the state with <InlineEquation><TeX>M_\text{s}=-\frac{1}{2}</TeX></InlineEquation> is the spin-down state.</Paragraph></Section><Section id="nonumber-id13"><Title>3.2 Representing a general spin state</Title><Paragraph>A ket can also be considered as a vector. The spin-up state is often represented by the symbol <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and the spin-down state by the symbol <InlineEquation><TeX>| \downarrow \rangle</TeX></InlineEquation>.  The spin-up state obeys</Paragraph><Equation><TeX>  \mathrm{\widehat{S}}_z  | \uparrow \rangle = +\frac{\hbar}{2} | \uparrow \rangle</TeX><Label>(7)</Label></Equation><Paragraph>and the spin-down state obeys</Paragraph><Equation><TeX>  \mathrm{\widehat{S}}_z  | \downarrow \rangle = -\frac{\hbar}{2} | \downarrow \rangle.</TeX><Label>(8)</Label></Equation><Paragraph>The spin vectors are <GlossaryTerm>normalised</GlossaryTerm> and <GlossaryTerm>orthogonal</GlossaryTerm> to one another, as represented by the following relations:</Paragraph><Equation><TeX>\begin{split}  
 \langle {\uparrow}|{\uparrow} \rangle   &amp; = \langle {\downarrow}|{\downarrow} \rangle =1 \quad \text{(normalized)}\\
\langle {\uparrow}|{\downarrow} \rangle   &amp;= \langle {\downarrow}|{\uparrow} \rangle =0 \quad \text{(orthogonal)} \end{split}</TeX></Equation><Paragraph>where these equations use additional notation. <InlineEquation><TeX>\langle ~~ |</TeX></InlineEquation> is known as a <GlossaryTerm>bra</GlossaryTerm> and the combination of the bra and ket together is an <GlossaryTerm>inner product</GlossaryTerm>, <InlineEquation><TeX>\langle ~~ | ~~ \rangle</TeX></InlineEquation>.</Paragraph><Paragraph>A general spin state <InlineEquation><TeX>| A \rangle</TeX></InlineEquation> can be written as a linear combination of <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| \downarrow  \rangle</TeX></InlineEquation>, thus</Paragraph><Equation><TeX>| A \rangle = a_1 | \uparrow \rangle + a_2 | \downarrow \rangle</TeX><Label>(9)</Label></Equation><Paragraph>where <InlineEquation><TeX>a_1</TeX></InlineEquation> and <InlineEquation><TeX>a_2</TeX></InlineEquation> are complex numbers referred to as <GlossaryTerm>probability amplitudes</GlossaryTerm>.</Paragraph><Paragraph>In other words, <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| \downarrow \rangle</TeX></InlineEquation> provide an <GlossaryTerm>orthonormal basis</GlossaryTerm> for <GlossaryTerm>spin space</GlossaryTerm>. The vectors <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and  <InlineEquation><TeX>| \downarrow \rangle</TeX></InlineEquation> are called <GlossaryTerm>basis vectors</GlossaryTerm>. 
Because any spin state <InlineEquation><TeX>| A \rangle</TeX></InlineEquation> can be written as a linear combination of just two basis vectors, the spin space of a spin-&#xBD;  particle is two-dimensional.</Paragraph><Paragraph>For an atom in any spin state, <InlineEquation><TeX>| A \rangle</TeX></InlineEquation>, as given in Equation 9 the probability of the outcome of a measurement indicating spin-up is <InlineEquation><TeX>| a_1 |^2</TeX></InlineEquation> and for spin-down is <InlineEquation><TeX>|a_2|^2</TeX></InlineEquation>. Since these are the only possible outcomes, the corresponding probabilities must sum to one, therefore</Paragraph><Equation><TeX> |a_1|^2+|a_2|^2=1.</TeX></Equation><Paragraph>Matrices can be used as an alternative representation of spin states to simplify calculations. <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and  <InlineEquation><TeX>| \downarrow \rangle</TeX></InlineEquation> are represented by the following column vectors:</Paragraph><Equation><TeX>| \uparrow \rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \quad \text{and} \quad | \downarrow \rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix} </TeX></Equation><Paragraph>These matrices have two elements because spin space is two-dimensional. Spin states that do not have definite values of <InlineEquation><TeX>S_z</TeX></InlineEquation> are expressed as linear combinations of <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| \downarrow \rangle</TeX></InlineEquation>.</Paragraph><Paragraph>Any vector <InlineEquation><TeX>| A \rangle</TeX></InlineEquation> in spin space may be written as a linear combination of <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| \downarrow \rangle</TeX></InlineEquation>. This means that <InlineEquation><TeX>| A \rangle</TeX></InlineEquation>, as defined in Equation 9 becomes:</Paragraph><Equation><TeX>| A \rangle = a_1 \begin{bmatrix} 1 \\ 0 \end{bmatrix}  + a_2 \begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} a_1 \\ a_2 \end{bmatrix}  </TeX></Equation><Paragraph> In this way any spin state of a spin-&#xBD; particle can be represented as a two-element matrix, which is called a <GlossaryTerm>spinor</GlossaryTerm>.</Paragraph><Paragraph>The inner product in spin space of two vectors in matrix form is written</Paragraph><Equation><TeX>\langle {A}|{B} \rangle =a_1^* b_1 + a_2^* b_2,</TeX></Equation><Paragraph> which is consistent with the matrix multiplication:</Paragraph><Equation><TeX> a_1^* b_1 + a_2^* b_2 = \begin{bmatrix} a_1^* &amp; a_2^* \end{bmatrix} \begin{bmatrix} {b_1}\\ {b_2} \end{bmatrix},</TeX></Equation><Paragraph>and thus the inner product of two spin vectors can be written in the matrix form:</Paragraph><Equation><TeX>\langle A | B \rangle = \begin{bmatrix} a_1^* &amp; a_2^* \end{bmatrix} \begin{bmatrix} {b_1}\\ {b_2} \end{bmatrix}.</TeX></Equation><Paragraph>We can therefore identify the separate bra and ket vectors as follows:</Paragraph><Equation><TeX>\langle A | = \begin{bmatrix} a_1^* &amp; a_2^* \end{bmatrix} \quad \text{and} \quad | B \rangle = \begin{bmatrix} {b_1}\\ {b_2} \end{bmatrix}.</TeX></Equation><Paragraph>A ket spin vector is represented by a <GlossaryTerm>column spinor</GlossaryTerm>, and a bra spin vector is represented by a <GlossaryTerm>row spinor</GlossaryTerm>. To convert a column spinor into the corresponding row spinor, the rule is to turn the column into a row and take the complex conjugate of all elements. So</Paragraph><Equation><TeX>\text{if} \quad  |A \rangle = \begin{bmatrix} {a_1}\\ {a_2} \end{bmatrix}, \quad \text{then} \quad \langle A | = \begin{bmatrix} a_1^* &amp; a_2^* \end{bmatrix}.</TeX></Equation><Paragraph>When using a matrix representation, the spin operators are also represented as matrices, for example,</Paragraph><Equation><TeX>\mathrm{\widehat{S}}_z = \frac{\hbar}{2}\begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix}</TeX></Equation><Paragraph>Rewriting Equation 7 using matrices gives, </Paragraph><Equation><TeX>\mathrm{\widehat{S}}_z  \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \frac{\hbar}{2} \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \frac{\hbar}{2}  \begin{bmatrix} 1 \\ 0 \end{bmatrix}</TeX></Equation><Paragraph> where you can see that carrying out the matrix multiplication gives the expected result.</Paragraph><Paragraph>The operators for a spin-&#xBD; particle are each represented by <InlineEquation><TeX>2 \times 2</TeX></InlineEquation> matrices. Along the three axes these are: </Paragraph><Equation><TeX>\mathrm{\widehat{S}}_x = \frac{\hbar}{2}\begin{bmatrix} 0 &amp; 1 \\ 1 &amp; 0 \end{bmatrix},  \quad \mathrm{\widehat{S}}_y = \frac{\hbar}{2} \begin{bmatrix} 0 &amp; -\mathrm{i} \\ \mathrm{i} &amp; 0 \end{bmatrix},  \quad \mathrm{\widehat{S}}_z = \frac{\hbar}{2} \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix}</TeX></Equation><Paragraph>It is common to define the so called <GlossaryTerm>Pauli operators</GlossaryTerm>, <InlineEquation><TeX>\widehat{\sigma}</TeX></InlineEquation>, as <InlineEquation><TeX>\mathrm{\widehat{S}} = \frac{\hbar}{2} \widehat{\sigma}</TeX></InlineEquation> such that we have the following Pauli operator matrices:</Paragraph><Equation><TeX>\widehat{\sigma}_x = \begin{bmatrix} 0 &amp; 1 \\ 1 &amp; 0 \end{bmatrix}, \quad \widehat{\sigma}_y = \begin{bmatrix} 0 &amp; -\mathrm{i} \\ \mathrm{i} &amp; 0 \end{bmatrix},  \quad \widehat{\sigma}_z = \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix}</TeX></Equation><Paragraph>These will be useful in the context of quantum computing where they can be used to represent the action of quantum gates.</Paragraph><Exercise><Heading>Exercise 8</Heading><Question><Paragraph>Show that the spin vectors</Paragraph><Equation><TeX>| U \rangle = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 \\ 1 \end{bmatrix} \quad \text{and} \quad | V \rangle = \frac{1}{\sqrt{2}} \begin{bmatrix} -1 \\ 1 \end{bmatrix}</TeX></Equation><Paragraph>are normalized and orthogonal, i.e. <InlineEquation><TeX>\langle U | U\rangle = \langle V | V \rangle =1</TeX></InlineEquation> and <InlineEquation><TeX>\langle U | V \rangle = 0</TeX></InlineEquation>.</Paragraph></Question><Answer><Paragraph>Using matrix multiplication</Paragraph><Equation><TeX>\langle U | U \rangle = \frac{1}{2} \begin{bmatrix} 1 &amp; 1 \end{bmatrix} \begin{bmatrix} 1 \\ 1 \end{bmatrix} = \frac{1}{2} ( 1 + 1) = 1 </TeX></Equation><Equation><TeX>\langle V | V \rangle = \frac{1}{2} \begin{bmatrix} -1 &amp; 1 \end{bmatrix} \begin{bmatrix} -1 \\ 1 \end{bmatrix} = \frac{1}{2} ( 1 + 1) = 1 </TeX></Equation><Equation><TeX>\langle U | V \rangle = \frac{1}{2} \begin{bmatrix} 1 &amp; 1 \end{bmatrix} \begin{bmatrix} -1 \\ 1 \end{bmatrix} = \frac{1}{2} ( -1 + 1) = 0 </TeX></Equation><Paragraph>The first two equations show that the vectors <InlineEquation><TeX>|U \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| V \rangle</TeX></InlineEquation> are normalised; the third that they are orthogonal to each other. Hence, they are orthonormal.</Paragraph></Answer></Exercise></Section><Section id="nonumber-id14"><Title>3.3 Spin observables</Title><Paragraph>In quantum mechanics measurable quantities are called observables. Spin is an example of an observable because it can be measured in an experiment. (Position and orbital angular momentum are other examples of observables.) Each observable is associated with an operator and, in general, the only possible outcomes of a measurement of an observable are any of the eigenvalues. </Paragraph><Paragraph>When a <GlossaryTerm>measurement</GlossaryTerm> is performed on a quantum system with spin, the wavefunction collapses into one of the eigenstates of the observable being measured. For example, if we measure the spin of an electron along the <i>z</i>-axis, the quantum state <i>collapses</i> into one of the two basis states: <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> or <InlineEquation><TeX>| \downarrow \rangle</TeX></InlineEquation> with probabilities determined by the initial state before measurement (see Equation 9). This collapse means and any superposition that existed before the measurement is lost. </Paragraph><Paragraph>After the measurement, the electron will be in a new well-defined spin state, either spin-up or spin-down depending on the result of the measurement. The general spin state has collapsed into one of the eigenstates due to being measured. As long as the initial general spin state is not an eigenstate, the spin state after the measurement will be different from the spin state before the measurement.</Paragraph><Exercise><Heading>Exercise 9</Heading><Question><Paragraph>Particles are prepared in the spin state</Paragraph><Equation><TeX>| A \rangle = \frac{\sqrt{3}}{2}| \uparrow \rangle + \frac{1}{2}| \downarrow \rangle</TeX></Equation><NumberedList class="lower-alpha"><ListItem><Paragraph>If a single particle is prepared in the state <InlineEquation><TeX>| A \rangle</TeX></InlineEquation>, what prediction can be made about the result of measuring <InlineEquation><TeX>S_z</TeX></InlineEquation> for this particle?</Paragraph></ListItem><ListItem><Paragraph>If a million particles are prepared identically, all in the state <InlineEquation><TeX>| A \rangle</TeX></InlineEquation>, what prediction can be made about the results of measuring <InlineEquation><TeX>S_z</TeX></InlineEquation> for this collection of particles?</Paragraph></ListItem></NumberedList></Question><Answer><NumberedList class="lower-alpha"><ListItem><Paragraph>No definite prediction can be made for a single particle in the given state, but a measurement of <InlineEquation><TeX>S_z</TeX></InlineEquation> will give <i>either</i> <InlineEquation><TeX>+\hbar/2</TeX></InlineEquation> <i>or</i> <InlineEquation><TeX>-\hbar/2</TeX></InlineEquation>; see Equations 7 and 8. In given state <InlineEquation><TeX>| A \rangle</TeX></InlineEquation> and using Equation 9, <InlineEquation><TeX>a_1 = \sqrt{3}/2</TeX></InlineEquation> and <InlineEquation><TeX>a_2 = 1/2</TeX></InlineEquation> so the probability of getting <InlineEquation><TeX>+\hbar/2</TeX></InlineEquation> is <InlineEquation><TeX>(\sqrt{3}/2)^2 = 3/4</TeX></InlineEquation> and the probability of getting <InlineEquation><TeX>-\hbar/2</TeX></InlineEquation> is <InlineEquation><TeX>(1/2)^2 = 1/4</TeX></InlineEquation>. As expected these two probabilities sum to unity because for any measurement either one or the other outcome will be obtained. This shows that the value <InlineEquation><TeX>+\hbar/2</TeX></InlineEquation> is more likely, but the value <InlineEquation><TeX>-\hbar/2</TeX></InlineEquation> would not be that surprising.</Paragraph></ListItem><ListItem><Paragraph>For a million particles, the expected outcome is that close to three-quarters or 750,000 measurements will give <InlineEquation><TeX>S_z = +\hbar/2</TeX></InlineEquation>, and the remainder will give <InlineEquation><TeX>S_z = -\hbar/2</TeX></InlineEquation>.</Paragraph></ListItem></NumberedList></Answer></Exercise></Section><Section id="nonumber-id15"><Title>3.4 Two-particle spin states</Title><Paragraph>If we have two indistinguishable<footnote>Particles are indistinguishable when they are identical (i.e. they have the same intrinsic properties like mass, charge, and spin) and they are so close together that their wavefunctions overlap so that we cannot tell them apart, even in principle.</footnote> electrons, we can define a two-particle spin state.  Due to symmetry and the rules of quantum mechanical addition of angular momentum, there are <i>four</i> possible spin states in total. These spin states are represented using the quantum numbers <InlineEquation><TeX>S</TeX></InlineEquation> and <InlineEquation><TeX>M_\text{s}</TeX></InlineEquation>, as introduced in Section 3.1, but now the quantum numbers are the sum of the values for the individual electrons. Therefore the spin quantum number is <InlineEquation><TeX>S= \frac{1}{2} + \frac{1}{2} = 1</TeX></InlineEquation> or <InlineEquation><TeX>S= \frac{1}{2} - \frac{1}{2} = 0</TeX></InlineEquation> and, for the case when <InlineEquation><TeX>S=1</TeX></InlineEquation>, the spin magnetic quantum is <InlineEquation><TeX>M_\text{s} = \pm \frac{1}{2} \pm \frac{1}{2} = -1 \, \text{or} \, 0 \, \text{or} \, +1 </TeX></InlineEquation>, while for the case when <InlineEquation><TeX>S=0</TeX></InlineEquation>, we only have <InlineEquation><TeX>M_\text{s} = + \frac{1}{2} - \frac{1}{2} = 0</TeX></InlineEquation>.</Paragraph><Paragraph>Such a two-particle spin state therefore can only have an overall spin function which is either symmetric or antisymmetric with respect to exchange of the electrons.   The symmetric spin state is referred to as a triplet because there are three possible symmetric combinations:</Paragraph><Equation><TeX>\begin{split} | 1, 1 \rangle &amp; = | \uparrow \uparrow \rangle \\
 | 1, 0 \rangle &amp; = \frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle + | \downarrow \uparrow \rangle ) \\
 | 1, -1 \rangle &amp; = | \downarrow \downarrow \rangle \end{split} </TeX></Equation><Paragraph>where the first arrow in each ket refers to particle 1 and the second to particle 2. The antisymmetric spin state is referred to as a singlet because there is only one possible combination:</Paragraph><Equation><TeX>| 0, 0 \rangle  = \frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle - | \downarrow \uparrow \rangle )</TeX><Label>(10)</Label></Equation><Paragraph>You can see that the states <InlineEquation><TeX>| \uparrow \uparrow \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| \downarrow \downarrow \rangle</TeX></InlineEquation> can be factorised into <InlineEquation><TeX>| \uparrow \rangle_1 | \uparrow \rangle_2</TeX></InlineEquation> and <InlineEquation><TeX>| \downarrow \rangle_1 | \downarrow \rangle_2</TeX></InlineEquation> respectively, where the subscripts label each particle. In contrast, the states <InlineEquation><TeX>\frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle + | \downarrow \uparrow \rangle )</TeX></InlineEquation> and <InlineEquation><TeX>\frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle - | \downarrow \uparrow \rangle )</TeX></InlineEquation> cannot be factorised into the product of a particle 1 state multiplied by a particle 2 state. Two-particle states which <i>cannot</i> be factorised are known as <GlossaryTerm>entangled states</GlossaryTerm> and said to exhibit <GlossaryTerm>entanglement</GlossaryTerm>.
</Paragraph><Exercise><Heading>Exercise 10</Heading><Question><Paragraph>Verify that the three spin kets </Paragraph><Equation><TeX>\begin{split} | 1, 1 \rangle &amp; = | \uparrow \uparrow \rangle , \\
 | 1, 0 \rangle &amp; = \frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle + | \downarrow \uparrow \rangle ), \\
 | 1, -1 \rangle &amp; = | \downarrow \downarrow \rangle \end{split}</TeX></Equation><Paragraph>are symmetric with respect to swapping the labels of the particles.</Paragraph></Question><Answer><Paragraph>Starting with</Paragraph><Equation><TeX>\frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle + | \downarrow \uparrow \rangle ) = \frac{1}{\sqrt{2}} ( | \uparrow \rangle_1 | \downarrow \rangle_2 + | \downarrow \rangle_1 | \uparrow \rangle_2 ), </TeX></Equation><Paragraph>exchanging the particle labels and then rearranging gives</Paragraph><Equation><TeX>\begin{split}  \frac{1}{\sqrt{2}} ( | \uparrow \rangle_2 | \downarrow \rangle_1 + | \downarrow \rangle_2 | \uparrow \rangle_1 ) 
&amp; =   \frac{1}{\sqrt{2}} ( | \downarrow \rangle_1 | \uparrow \rangle_2 + | \uparrow \rangle_1 | \downarrow \rangle_2 ) \\
&amp; =  \frac{1}{\sqrt{2}} ( | \uparrow \rangle_1 | \downarrow \rangle_2 + | \downarrow \rangle_1 | \uparrow \rangle_2 ) \\
&amp; =  \frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle + | \downarrow \uparrow \rangle ). \end{split}</TeX></Equation><Paragraph>Since this final expression is identical to the initial expression, this shows <InlineEquation><TeX>\frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle + | \downarrow \uparrow \rangle )</TeX></InlineEquation> is symmetric to swapping particle labels.</Paragraph><Paragraph>For <InlineEquation><TeX>| \uparrow \uparrow \rangle = | \uparrow \rangle_1 | \uparrow \rangle_2</TeX></InlineEquation> and <InlineEquation><TeX>| \downarrow \downarrow \rangle = | \downarrow \rangle_1 | \downarrow \rangle_2</TeX></InlineEquation>  the particle labels are interchanged and re-ordered (perfectly acceptable!) to get the same expressions as required.</Paragraph></Answer></Exercise></Section><Section id="nonumber-id16"><Title>3.5 Entanglement</Title><Paragraph><GlossaryTerm>Entanglement</GlossaryTerm> is a consequence of quantum theory and leads to a correlation between the outcomes of measurements which cannot be explained by classical physics. Two-particle states which show such non-classical correlations are known as <GlossaryTerm>entangled states</GlossaryTerm>. </Paragraph><Paragraph>Consider the following thought experiment. Suppose you have a two-particle system in the spin state <InlineEquation><TeX>|0,0\rangle</TeX></InlineEquation> as given in Equation 10. Before the experiment you know that particle 1 can be either spin-up or spin-down with equal probability. However, if you measure particle 1 to be spin-up then you know that particle 2 is spin-down as the measurement means that the two-particle state has collapsed into the <InlineEquation><TeX>| \uparrow \downarrow \rangle</TeX></InlineEquation> arrangement of spins. In contrast, if you measure particle 1 to be spin-down then you know that particle 2 is spin-up as the two-particle state has collapsed into the <InlineEquation><TeX>| \downarrow \uparrow \rangle</TeX></InlineEquation> arrangement of spins. This type of prediction is quite puzzling because the two entangled particles can be as far apart as possible and when a measurement is made on particle 1 then it is known simultaneously what the outcome of a measurement on particle 2 will be.</Paragraph><Paragraph>Entanglement is essential for quantum computing. Entangled states are generated as part of the workings of a quantum computer, as you will see later.</Paragraph><Exercise><Heading>Exercise 11</Heading><Question><Paragraph> Confirm that the following states are normalised and determine whether the states are entangled.</Paragraph><NumberedList class="lower-alpha"><ListItem><Equation><TeX>| B \rangle = \frac{1}{\sqrt{2}} | \uparrow \downarrow \rangle -  \frac{1}{\sqrt{2}} | \uparrow \uparrow \rangle</TeX></Equation></ListItem><ListItem><Equation><TeX>| C \rangle = \frac{1}{2} | \uparrow \uparrow \rangle - \frac{1}{\sqrt{2}} | \uparrow \downarrow \rangle -  \frac{\text{i}}{2} | \downarrow \downarrow \rangle</TeX></Equation></ListItem></NumberedList></Question><Answer><Paragraph>The normalisation condition for a general two-particle state is that the sum of the squares of the probability amplitudes is equal to 1.</Paragraph><Paragraph>The states are entangled if the two-particle state cannot be factorised into the product of a particle 1 state multiplied by a particle 2 state.</Paragraph><NumberedList class="lower-alpha"><ListItem><Paragraph>Checking the normalisation of state <InlineEquation><TeX>| B \rangle</TeX></InlineEquation>:</Paragraph><Equation><TeX> \left|\frac{1}{\sqrt{2}}\right|^2 +  \left|-\frac{1}{\sqrt{2}}\right|^2  = \frac{1}{2} + \frac{1}{2} = 1,</TeX></Equation><Paragraph>showing state <InlineEquation><TeX>| B \rangle</TeX></InlineEquation> is normalised. </Paragraph><Paragraph><InlineEquation><TeX>| B \rangle</TeX></InlineEquation> can also be factorised:</Paragraph><Equation><TeX>\begin{split}  | B \rangle &amp; = \frac{1}{\sqrt{2}} | \uparrow \downarrow \rangle - \frac{1}{\sqrt{2}} | \uparrow \uparrow \rangle \\
        &amp; = \frac{1}{\sqrt{2}} ( | \uparrow \rangle_1 | \downarrow \rangle_2 - | \uparrow \rangle_1 | \uparrow \rangle_2 )\\
         &amp; =  \frac{1}{\sqrt{2}} | \uparrow \rangle_1 \, ( | \downarrow \rangle_2 - | \uparrow \rangle_2) \end{split}</TeX></Equation><Paragraph>which is a particle 1 state multiplied by a particle 2 state so state <InlineEquation><TeX>| B \rangle</TeX></InlineEquation> is not entangled.</Paragraph></ListItem><ListItem><Paragraph>Checking the normalisation of state <InlineEquation><TeX>| C \rangle</TeX></InlineEquation>:</Paragraph><Equation><TeX>\left|\frac{1}{2}\right|^2 +  \left|-\frac{1}{\sqrt{2}}\right|^2 + \left| \frac{\text{i}}{2} \right|^2 = \frac{1}{4} + \frac{1}{2} + \frac{1}{4} = 1,</TeX></Equation><Paragraph>showing state <InlineEquation><TeX>| C \rangle</TeX></InlineEquation> is normalised. </Paragraph><Paragraph>State <InlineEquation><TeX>| C \rangle</TeX></InlineEquation> cannot be factorised and so is an entangled state.  </Paragraph></ListItem></NumberedList></Answer></Exercise></Section></Session><Session id="nonumber-id17"><Title>4 Classical computing</Title><Paragraph>In this section, you will be introduced to a few aspects of classical computing to give you a reference frame for discussing quantum computing. All computers work by taking input information and processing it using gates to give output information. By the end of the section, you will be familiar with the classical NOT and CNOT gates including their truth tables, so that you can compare them with the non-classical output of the quantum versions of these gates described in Section 5.  
</Paragraph><Section id="nonumber-id18"><Title>4.1 Classical bits and logic gates</Title><Paragraph>In classical computing, the smallest piece of information is called a <GlossaryTerm>bit</GlossaryTerm>. A bit may take only one of two <GlossaryTerm>logical values</GlossaryTerm>: either 0 or 1. Strings of bits are used to represent information as numbers, which can be stored, copied and processed by the computer. The processing of information is accomplished by <GlossaryTerm>logic gates</GlossaryTerm>, which take strings of bits as their input and produce an output value for each bit that they act on. A diagram showing how a logic gate works is given in Figure 4.  
</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/gate_input_output.jpg" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/gate_input_output.jpg" width="100%" x_folderhash="865a0355" x_contenthash="60e604a7" x_imagesrc="gate_input_output.jpg" x_imagewidth="217" x_imageheight="38"/><Caption><b>Figure 4</b> A diagram to illustrate how a logic gate works</Caption><Description><Paragraph>The figure shows a schematic of a logic gate with a string of binary numbers as input and a different string of binary numbers as output.</Paragraph></Description></Figure></Section><Section id="nonumber-id19"><Title>4.2 Classical Boolean gates</Title><Paragraph>A single-bit gate acts on one bit at a time. In classical computing, there are two universal single-bit gates, the <GlossaryTerm>NOT gate</GlossaryTerm> and the <GlossaryTerm>Reset gate</GlossaryTerm> which, either acting alone or in a sequence, can generate all possible transformations of a single bit.  </Paragraph><Paragraph>The NOT gate (Figure 5) simply flips the value of the bit to the alternative value, so a 0 becomes a 1, and a 1 becomes a 0.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_c01_f01.eps.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/sm380_c01_f01.eps.png" width="100%" x_folderhash="865a0355" x_contenthash="38efcee5" x_imagesrc="sm380_c01_f01.eps.png" x_imagewidth="194" x_imageheight="52"/><Caption><b>Figure 5</b> The symbol for a NOT gate</Caption><Description><Paragraph>The figure shows a horizontal line labelled as input leading to the base of a right-pointing equilateral triangle. At the right hand tip of the triangle is a small circle, followed by another horizontal line labelled as output.</Paragraph></Description></Figure><Paragraph>A <GlossaryTerm>truth table</GlossaryTerm> is a convenient way of summarising the action of a gate. The truth table for a NOT gate is given in Table 1.</Paragraph><Table><TableHead><b>Table 1</b> Classical NOT gate truth table</TableHead><tbody><tr><td borderright="true" borderbottom="true">Input</td><td borderbottom="true">Output</td></tr><tr><td borderright="true">0</td><td>1</td></tr><tr><td borderright="true">1</td><td>0</td></tr></tbody></Table><Paragraph>The Reset gate sets a bit to value 0, regardless of the input state.</Paragraph><Paragraph>Single-bit gates are not sufficient to perform computing: it is also necessary have <GlossaryTerm>conditional gates</GlossaryTerm> in which an operation on a <GlossaryTerm>target bit</GlossaryTerm> depends on the state of one or more <GlossaryTerm>control bits</GlossaryTerm>. It will be helpful to write the two input bits as an ordered pair of values,  <i>C</i><i>T</i> (for example, 01 has <i>C</i> = 0 and <i>T</i> = 1), where <i>C</i> represents the control bit and <i>T</i> the target bit. </Paragraph><Paragraph>An important two-bit gate is the <GlossaryTerm>CNOT gate</GlossaryTerm> (controlled NOT gate), which performs a NOT operation on the target bit conditional on the state of the control bit being 1; if the control bit is 0, then no operation is applied. The state of the control bit is unchanged by the CNOT operation. Table 2 is the truth table for the CNOT gate.</Paragraph><Table><TableHead><b>Table 2</b> Classical CNOT gate truth table</TableHead><tbody><tr><td borderright="true" borderbottom="true">Input</td><td borderbottom="true">Output</td></tr><tr><td borderright="true">0 0</td><td>0 0</td></tr><tr><td borderright="true">0 1</td><td>0 1</td></tr><tr><td borderright="true">1 0</td><td>1 1</td></tr><tr><td borderright="true">1 1</td><td>1 0</td></tr></tbody></Table><Paragraph>To perform classical computing, the bits are set to some initial values and the gates are applied to the bits in an ordered sequence to make an algorithm. </Paragraph><Paragraph>Quantum computing has different sets of universal gates, which include quantum versions of the NOT and CNOT gates.</Paragraph></Section></Session><Session id="nonumber-id20"><Title>5 Qubits and quantum gates</Title><Paragraph>Quantum computing is based on units of information called <GlossaryTerm>qubits</GlossaryTerm> (quantum bits, and pronounced <i>kew-bits</i>), which obey the laws of quantum mechanics. 
A qubit is the quantum analogue of a classical bit. The classical bit values 0 and 1 are replaced by the orthonormal basis states of the quantum-mechanical qubit <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation>. The basis states are given the name <GlossaryTerm>logical states</GlossaryTerm>, since they correspond to the classical bits upon which the logic gates operate. The key difference between qubits and classical bits is that qubits can exist in a superposition of the <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation>  and <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation>states, which means qubits can be prepared in the superposition state:</Paragraph><Equation><TeX>| \psi \rangle = a_0 | 0 \rangle + a_1 | 1 \rangle</TeX></Equation><Paragraph>Remarkably, you can take logic gates similar to the Boolean logic gates of classical computing and apply them to the qubits. In doing so, the input state of the qubits is transformed into the output state. To obtain the result of the computation, the value (0 or 1) of each qubit is measured. As you will see, the resulting outputs can include entangled states of two or more qubits.</Paragraph><Paragraph>Quantum entanglement is a fundamental resource for quantum computing as it involves the distribution of information in a fundamentally non-classical way.</Paragraph><Paragraph>In this section, you will learn the definition of a qubit and be introduced to some single-qubit and two-qubit logic gates. The quantum CNOT gate is an important gate as it can entangle and disentangle a pair of qubits. By the end of this section you will have been introduced to quantum circuits and there is a final activity to test your understanding.</Paragraph><Section id="nonumber-id21"><Title>5.1 Defining a qubit</Title><Paragraph>A qubit is defined by the equation</Paragraph><Equation><TeX>| \psi \rangle = a_0 | 0 \rangle + a_1 | 1 \rangle</TeX><Label>(11)</Label></Equation><Paragraph>where <InlineEquation><TeX>| \psi \rangle</TeX></InlineEquation> is a two-state quantum system and <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation>  and <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation> are logical states. Note that <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation> has a logical value of 0 and <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation> has a logical value of 1. <InlineEquation><TeX>a_0</TeX></InlineEquation> and <InlineEquation><TeX>a_1</TeX></InlineEquation> are the probability amplitudes which may be complex numbers and satisfy the normalisation condition <InlineEquation><TeX>|a_0|^2 + |a_1|^2 = 1</TeX></InlineEquation>.</Paragraph><Paragraph>Examples of qubits are the general spin states of spin-&#xBD; particles as described in Section 3.2. You can see that the spin-up state has been replaced by logical state <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation> and the spin-down state by logical state <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation> and you can see that Equation 9 and Equation 11 have a similiar form.</Paragraph><Paragraph>To fully specify the two complex amplitudes or four real numbers are required: the real and imaginary parts of each. However, the number of values can be reduced by two, one because of the normalisation condition, and one because the phase of one basis state can be set to zero without changing anything.</Paragraph><Paragraph>This leads to the equation,</Paragraph><Equation><TeX> | \psi \rangle = \cos(\theta/2)\, | 0 \rangle + \sin(\theta/2)\, \mathrm{e}^{\text{i} \phi} | 1 \rangle.</TeX></Equation><Paragraph>where <InlineEquation><TeX>\theta</TeX></InlineEquation> and <InlineEquation><TeX>\phi</TeX></InlineEquation> are real numbers with <InlineEquation><TeX>0\leq\theta\leq \pi</TeX></InlineEquation> and <InlineEquation><TeX>0\leq\phi\leq 2\pi</TeX></InlineEquation>.</Paragraph><Paragraph>A qubit state can therefore also be represented as a column vector</Paragraph><Equation><TeX> | \psi \rangle  = \begin{bmatrix} {\cos(\theta/2)} \\ {\sin(\theta/2)\, \mathrm{e}^{\text{i} \phi}} \end{bmatrix}.</TeX></Equation><Paragraph>This representation is like the spinor representation introduced in Section 3.2. The column vector representation is useful because the operators corresponding to single-qubit gates and observables may be written as 2 &#xD7; 2 matrices.
The qubit basis states are defined as</Paragraph><Equation><TeX>|0 \rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \quad \text{and} \quad |1 \rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix}  </TeX><Label>(12)</Label></Equation><Paragraph>The column vectors of Equations 12 are eigenstates of a 2 &#xD7; 2 matrix operator known as the Pauli-<i>Z</i> operator <InlineEquation><TeX>\widehat{\sigma}_z</TeX></InlineEquation> or <InlineEquation><TeX>\widehat{\mathrm{Z}}</TeX></InlineEquation>, which as mentioned earlier is defined as</Paragraph><Equation><TeX>\widehat{\sigma}_z = \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix}</TeX></Equation><Exercise><Heading>Exercise 12</Heading><Question><Paragraph>  Show that the qubit basis states <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation> are eigenvectors of the Pauli-<i>Z</i> operator and find the corresponding eigenvalues. Determine the relationship between the eigenvalues and the logical values of the basis states. Use the symbol, <i>m</i> to represent the logical value.</Paragraph></Question><Answer><Paragraph>Noting <InlineEquation><TeX>| 0 \rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix}</TeX></InlineEquation> and has logical value, <i>m</i> = 0; and <InlineEquation><TeX>| 1 \rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix}</TeX></InlineEquation> and has logical value, <i>m</i> = 1 and that <InlineEquation><TeX>\widehat{\sigma}_z = \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix}</TeX></InlineEquation></Paragraph><Paragraph>First, for basis state, <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation> the eigenvalue equation (Equation 2) becomes</Paragraph><Equation><TeX>\begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \lambda_0 \begin{bmatrix} 1 \\ 0 \end{bmatrix}</TeX></Equation><Paragraph>Doing the matrix multiplication gives</Paragraph><Equation><TeX>\begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \lambda_0 \begin{bmatrix} 1 \\ 0 \end{bmatrix}</TeX></Equation><Paragraph>showing that <InlineEquation><TeX>\lambda_0 = 1</TeX></InlineEquation></Paragraph><Paragraph>Similarly, for basis state <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation></Paragraph><Equation><TeX>\begin{bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix} \begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ -1 \end{bmatrix} = -\begin{bmatrix} 0 \\ 1 \end{bmatrix} = \lambda_1 \begin{bmatrix} 0 \\ 1 \end{bmatrix}</TeX></Equation><Paragraph>showing that <InlineEquation><TeX>\lambda_1 = -1</TeX></InlineEquation></Paragraph><Paragraph>Comparing the eigenvalues with the logical values: when <InlineEquation><TeX>\lambda_0 = 1</TeX></InlineEquation>, <i>m</i> = 0, and when <InlineEquation><TeX>\lambda_1 = -1</TeX></InlineEquation>, <i>m</i> = 1. The relationship between the eigenvalue and the logical value is therefore</Paragraph><Equation><TeX>m = \frac{1 - \lambda_m}{2}</TeX></Equation></Answer></Exercise></Section><Section id="nonumber-id22"><Title>5.2 Single qubit gates</Title><Paragraph>In quantum computing, a gate is a reversible transformation of a qubit state <InlineEquation><TeX>| \Psi \rangle</TeX></InlineEquation> to another qubit state <InlineEquation><TeX>| \Phi \rangle</TeX></InlineEquation>, represented by an operator <InlineEquation><TeX>\widehat{\mathrm{U}}</TeX></InlineEquation>. It is convenient to write the single-qubit gate operators as 2 &#xD7; 2 matrices. Therefore, the action of the gate <InlineEquation><TeX>\widehat{\mathrm{U}}</TeX></InlineEquation> can be written as follows:</Paragraph><Equation><TeX>\widehat{\mathrm{U}} | \Psi \rangle = | \Phi \rangle.</TeX></Equation><Paragraph>The word <i>reversible</i> is important because it is a reminder that a gate operation is of a different nature from a measurement. The operation of the gate can be reversed so that it is possible to get back to the state <InlineEquation><TeX>\Psi</TeX></InlineEquation>, whereas, in general, a measurement makes an irreversible change to the qubit state. <InlineEquation><TeX>\widehat{\mathrm{U}}^{\dagger}</TeX></InlineEquation> is defined as the operator needed to reverse the gate action and transform <InlineEquation><TeX>| \Phi \rangle</TeX></InlineEquation> back to <InlineEquation><TeX>| \Psi \rangle</TeX></InlineEquation>:</Paragraph><Equation><TeX>\widehat{\mathrm{U}}^{\dagger} | \Phi \rangle = | \Psi \rangle.</TeX></Equation><Paragraph>therefore</Paragraph><Equation><TeX>\widehat{\mathrm{U}}^{\dagger} \widehat{\mathrm{U}} | \Psi \rangle = | \Psi \rangle,</TeX></Equation><Paragraph>which means that</Paragraph><Equation><TeX>\widehat{\mathrm{U}}^{\dagger} \widehat{\mathrm{U}}  = \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; 1 \end{bmatrix} = \widehat{\mathrm{I}}</TeX><Label>(13)</Label></Equation><Paragraph>where <InlineEquation><TeX>\widehat{\mathrm{I}}</TeX></InlineEquation> is the identity operator, represented by the 2 &#xD7; 2 matrix appearing in Equation 13. An operator, <InlineEquation><TeX>\widehat{\mathrm{U}}</TeX></InlineEquation> that obeys Equation 13 is called a <GlossaryTerm>unitary operator</GlossaryTerm>, hence gates are represented by unitary operators. The identity operator is itself a gate, denoted <InlineEquation><TeX>\widehat{\mathrm{I}}</TeX></InlineEquation>, and its symbol is shown in Figure &#x2018;6.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_c01_f03.eps.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/sm380_c01_f03.eps.png" width="100%" x_folderhash="865a0355" x_contenthash="5ca0e722" x_imagesrc="sm380_c01_f03.eps.png" x_imagewidth="217" x_imageheight="38"/><Caption><b>Figure 6</b> The symbol used in a quantum circuit for an identity gate, <InlineEquation><TeX>\widehat{\mathrm{I}}</TeX></InlineEquation></Caption><Description><Paragraph>The figure shows a horizontal line on the left leading to a square box with the capital letter I in it, then a horizontal line leading from the box to the right. </Paragraph></Description></Figure><Paragraph>You will now look at some gates, starting with the quantum NOT gate. (From now on the prefix <i>quantum</i> will be omitted as long as it is obvious the gates are quantum gates and not classical gates from the context.)
</Paragraph><SubSection id="nonumber-id23"><Title>5.2.1 The NOT gate</Title><Paragraph>The NOT gate is denoted by the operator, <InlineEquation><TeX>\widehat{\mathrm{X}}</TeX></InlineEquation> and, in the basis of the logical qubits <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation>, is represented by the matrix</Paragraph><Equation><TeX>\widehat{\mathrm{X}} = \begin{bmatrix} 0 &amp; 1 \\ 1 &amp; 0 \end{bmatrix}.</TeX></Equation><Paragraph>which is also the Pauli-<i>X</i> operator, <InlineEquation><TeX>\widehat{\sigma}_x</TeX></InlineEquation>, mentioned earlier. In a circuit diagram representing a quantum algorithm, the symbol for the NOT gate is shown in Figure 7.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_c01_f04.eps.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/sm380_c01_f04.eps.png" width="100%" x_folderhash="865a0355" x_contenthash="321a319a" x_imagesrc="sm380_c01_f04.eps.png" x_imagewidth="217" x_imageheight="37"/><Caption><b>Figure 7</b> The symbol used in a quantum circuit for a NOT gate, <InlineEquation><TeX>\widehat{\mathrm{X}}</TeX></InlineEquation></Caption><Description><Paragraph>The figure shows a horizontal line on the left leading to a circle with a large plus sign in it, then a horizontal line leading from the box to the right. </Paragraph></Description></Figure><Paragraph>In quantum computing, the truth table specifies outcomes for the logical states <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation>. In Table 3 the general superposition state is also included for reference.</Paragraph><Table><TableHead><b>Table 3</b> Quantum NOT gate truth table</TableHead><tbody><tr><td borderright="true" borderbottom="true">Input</td><td borderbottom="true">Output</td></tr><tr><td borderright="true"><InlineEquation><TeX>|0 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>|1 \rangle</TeX></InlineEquation></td></tr><tr><td borderright="true"><InlineEquation><TeX>|1 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>|0 \rangle</TeX></InlineEquation></td></tr><tr><td borderright="true"><InlineEquation><TeX>a_0 |0 \rangle  + a_1 | 1 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>a_0 |1 \rangle  + a_1 | 0 \rangle</TeX></InlineEquation></td></tr></tbody></Table></SubSection><SubSection id="nonumber-id24"><Title>5.2.2 The Hadamard gate</Title><Paragraph>    The <GlossaryTerm>Hadamard gate</GlossaryTerm> is a single-qubit gate defined by a matrix <InlineEquation><TeX>\widehat{\mathrm{H}}</TeX></InlineEquation> </Paragraph><Equation><TeX>\widehat{\mathrm{H}} = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; -1 \end{bmatrix}.</TeX></Equation><Paragraph>In a circuit diagram representing a quantum algorithm, the symbol for the Hadamard gate is shown in Figure 8.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_c01_f05.eps.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/sm380_c01_f05.eps.png" width="100%" x_folderhash="865a0355" x_contenthash="40f95dda" x_imagesrc="sm380_c01_f05.eps.png" x_imagewidth="127" x_imageheight="37"/><Caption><b>Figure 8</b> The symbol used in a quantum circuit for a Hadamard gate, <InlineEquation><TeX>\widehat{\mathrm{H}}</TeX></InlineEquation></Caption><Description><Paragraph>The figure shows a horizontal line on the left leading to a square box with a capital letter H in it, then a horizontal line leading from the box to the right. </Paragraph></Description></Figure><Paragraph>Consider the action of a Hadamard gate on logical state <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation>. </Paragraph><Paragraph>First, the gate and logical state are written as matrices,</Paragraph><Equation><TeX>\widehat{\mathrm{H}} | 0 \rangle = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix}</TeX></Equation><Paragraph>Next, the matrices are multiplied to obtain the final state matrix</Paragraph><Equation><TeX>\frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; -1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \frac{1}{\sqrt{2}}  \begin{bmatrix} 1 \\ 1 \end{bmatrix}</TeX></Equation><Paragraph>Finally, the final state matrix is rewritten in terms of the logical states <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation>:</Paragraph><Equation><TeX>\frac{1}{\sqrt{2}}  \begin{bmatrix} 1 \\ 1 \end{bmatrix} = \frac{1}{\sqrt{2}}  \begin{bmatrix} 1 \\ 0 \end{bmatrix} + \frac{1}{\sqrt{2}}  \begin{bmatrix} 0 \\ 1 \end{bmatrix} = \frac{1}{\sqrt{2}} ( | 0 \rangle + | 1 \rangle )</TeX></Equation><Paragraph>You can see that the final output state, <InlineEquation><TeX>\frac{1}{\sqrt{2}} ( | 0 \rangle + | 1 \rangle )</TeX></InlineEquation> is a superposition state. This calculation shows that <b>a Hadamard gate allows the transformation of the logical qubit state into a superposition state</b>.</Paragraph><Exercise><Heading>Exercise 13</Heading><Question><Paragraph>Use matrices to work out the action of a Hadamard gate on logical state <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation>.</Paragraph></Question><Answer><Paragraph>Noting, logical state <InlineEquation><TeX>| 1 \rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix}</TeX></InlineEquation>  and the Hadamard gate is <InlineEquation><TeX>\widehat{\mathrm{H}} = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; -1 \end{bmatrix}.</TeX></InlineEquation> Using matrices gives</Paragraph><Equation><TeX>\begin{split}  \widehat{\mathrm{H}} | 1 \rangle &amp; = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; -1 \end{bmatrix} \begin{bmatrix} 0 \\ 1 \end{bmatrix}   = \frac{1}{\sqrt{2}}  \begin{bmatrix} 1 \\ -1 \end{bmatrix} \\  
 &amp; =  \frac{1}{\sqrt{2}}  \begin{bmatrix} 1 \\ 0 \end{bmatrix} - \frac{1}{\sqrt{2}}  \begin{bmatrix} 0 \\ 1 \end{bmatrix}  \\
 &amp; =  \frac{1}{\sqrt{2}} ( | 0 \rangle - | 1 \rangle ) \end{split}</TeX></Equation><Paragraph>You can see that the Hadamard gate has transformed logical state <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation> into a superposition state.</Paragraph></Answer></Exercise><Paragraph>The effect on a general state can be determined by combining the results of the action of a Hadamard gate on logical states <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation>. </Paragraph><Equation><TeX>\begin{split} \widehat{\mathrm{H}} ( a_0 | 0 \rangle + a_1 | 1 \rangle ) &amp; = a_0 \widehat{\mathrm{H}} | 0 \rangle + a_1 \widehat{\mathrm{H}} | 1 \rangle \\
&amp; =  \frac{a_0}{\sqrt{2}} ( | 0 \rangle + | 1 \rangle ) + \frac{a_1}{\sqrt{2}} ( | 0 \rangle - | 1 \rangle ) \\
&amp; = \frac{1}{\sqrt{2}} ( a_0 + a_1) | 0 \rangle + \frac{1}{\sqrt{2}} ( a_0 - a_1) | 1 \rangle \end{split}</TeX></Equation><Paragraph>All these results are summarised in the truth table for the Hadamard gate in Table 4.</Paragraph><Table><TableHead><b>Table 4</b> Hadamard gate truth table</TableHead><tbody><tr><td borderright="true" borderbottom="true">Input</td><td borderbottom="true">Output</td></tr><tr><td borderright="true"><InlineEquation><TeX>|0 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>\frac{1}{\sqrt{2}} (| 0 \rangle + |1 \rangle)</TeX></InlineEquation></td></tr><tr><td borderright="true"><InlineEquation><TeX>|1 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>\frac{1}{\sqrt{2}} (| 0 \rangle - |1 \rangle)</TeX></InlineEquation></td></tr><tr><td borderright="true"><InlineEquation><TeX>a_0 |0 \rangle  + a_1 | 1 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>\frac{1}{\sqrt{2}} ( a_0 + a_1) | 0 \rangle + \frac{1}{\sqrt{2}} ( a_0 - a_1) | 1 \rangle </TeX></InlineEquation></td></tr></tbody></Table></SubSection><SubSection id="nonumber-id25"><Title>5.2.3 Sequences of gates</Title><Paragraph>The next step towards quantum computing is to combine gates sequentially to give a <GlossaryTerm>quantum circuit</GlossaryTerm>. In a circuit, successive operations are applied to a single qubit.</Paragraph><Paragraph>If you first apply the NOT gate, and then apply the Hadamard gate, the mathematical expression representing this is written as a sequence of operators, operating from right to left on the qubit <InlineEquation><TeX>| \psi \rangle</TeX></InlineEquation>:</Paragraph><Equation><TeX>| \phi \rangle = \widehat{\mathrm{H}}\widehat{\mathrm{X}} | \psi \rangle</TeX><Label>(14)</Label></Equation><Paragraph>This ordering of operators should not come as a surprise; reading the expression on the right hand side of Equation 14, first gate <InlineEquation><TeX>\widehat{\mathrm{X}}</TeX></InlineEquation> is applied to qubit <InlineEquation><TeX>| \psi \rangle</TeX></InlineEquation> to give an intermediate qubit, say <InlineEquation><TeX>| \alpha \rangle</TeX></InlineEquation>, and then gate <InlineEquation><TeX>\widehat{\mathrm{H}}</TeX></InlineEquation> is applied to <InlineEquation><TeX>| \alpha \rangle</TeX></InlineEquation> to give the final resultant <InlineEquation><TeX>| \phi \rangle</TeX></InlineEquation>. Alternatively, if calculating the outcome of 
<InlineEquation><TeX>\widehat{\mathrm{H}}\widehat{\mathrm{X}}</TeX></InlineEquation> on qubit <InlineEquation><TeX>| \psi \rangle</TeX></InlineEquation>, the matrices representing <InlineEquation><TeX>\widehat{\mathrm{H}}</TeX></InlineEquation> and <InlineEquation><TeX>\widehat{\mathrm{X}}</TeX></InlineEquation> can be multiplied together to give a resultant matrix, which can be considered a new operator, <InlineEquation><TeX>\widehat{\mathrm{W}} = \widehat{\mathrm{H}} \widehat{\mathrm{X}}</TeX></InlineEquation>. Then operator, <InlineEquation><TeX>\widehat{\mathrm{W}}</TeX></InlineEquation> can be thought to act on <InlineEquation><TeX>| \psi \rangle</TeX></InlineEquation> to give the resultant <InlineEquation><TeX>| \phi \rangle</TeX></InlineEquation>.</Paragraph><Paragraph>The diagram representing this sequence is shown in Figure 9.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_c01_f06.eps.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/sm380_c01_f06.eps.png" width="100%" x_folderhash="865a0355" x_contenthash="fc1acd5d" x_imagesrc="sm380_c01_f06.eps.png" x_imagewidth="207" x_imageheight="38"/><Caption><b>Figure 9</b> A circuit for applying a NOT gate and a Hadamard gate in sequence</Caption><Description><Paragraph>The figure shows a horizontal line on the left leading to a circle with a large plus sign in it, then a further horizontal line from the right of the circle leading to a square  box with a capital letter H in it, then a horizontal line leading from the box to the right. </Paragraph></Description></Figure><Paragraph>A circuit diagram represents the logical flow of the circuit from  the left (the initial state) to the right (the final state) of the diagram. Therefore, in the circuit shown in Figure 8, the elements are ordered from left to right: the NOT, which acts first, is on the left. </Paragraph><Paragraph>Note that the ordering of gates in the circuit diagram is the opposite to the ordering of gates when the circuit is written as a sequence of operators acting on a ket.</Paragraph><Paragraph>By matrix multiplication, any sequence of single-qubit gates can be represented by a single 2 &#xD7; 2 matrix found by forming an ordered product of the matrices representing the gates. You have to be careful because, in general, the single-qubit operators do not commute. In the next exercise you will see that the method using matrix multiplication to combine gates is equivalent to applying the gates sequentially.</Paragraph><Exercise><Heading>Exercise 14</Heading><Question><Paragraph>  Given the initial qubit state <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation>, show that the sequence of gates in Equation 14 produces the final state</Paragraph><Equation><TeX>| \psi \rangle = \frac{1}{\sqrt{2}} ( | 0 \rangle - | 1 \rangle ).</TeX></Equation><Paragraph>Show that you get the same result by applying either the gates in sequence or by using matrix multiplication to combine gates. </Paragraph></Question><Answer><Paragraph>Applying the gates in sequence from right to left:</Paragraph><Equation><TeX>\begin{split} | \psi \rangle &amp; = \widehat{\mathrm{H}} \widehat{\mathrm{X}} | 0 \rangle \\
&amp; = \widehat{\mathrm{H}} | 1 \rangle \quad \text{by definition of a NOT gate} \\
&amp; = \frac{1}{\sqrt{2}} (| 0 \rangle - | 1 \rangle ) \quad \text{using row 2 of Table 4} \end{split}</TeX></Equation><Paragraph>Using matrix multiplication to combine gates: First, calculate the product of the matrices <InlineEquation><TeX>\widehat{\mathrm{H}} \widehat{\mathrm{X}}</TeX></InlineEquation>:</Paragraph><Equation><TeX>\widehat{\mathrm{H}} \widehat{\mathrm{X}} = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; -1 \end{bmatrix}  \begin{bmatrix} 0 &amp; 1 \\ 1 &amp; 0 \end{bmatrix} =  \frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ -1 &amp; 1 \end{bmatrix}  </TeX></Equation><Paragraph>then apply this matrix to the column vector for <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation>:</Paragraph><Equation><TeX>\begin{split} | \psi \rangle &amp; = \widehat{\mathrm{H}} \widehat{\mathrm{X}} | 0 \rangle \\
&amp; = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ -1 &amp; 1 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix} \\
&amp; = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 \\  -1 \end{bmatrix} \\ 
&amp; = \frac{1}{\sqrt{2}} ( | 0 \rangle - | 1 \rangle ) \end{split}</TeX></Equation><Paragraph>which is the same final state as applying the gates in sequence, as expected.</Paragraph></Answer></Exercise></SubSection></Section><Section id="nonumber-id26"><Title>5.3 Two-qubit gates</Title><Paragraph>The gates discussed in Section 5.2 are examples of single-qubit gates, but these are insufficient for quantum computing. Just as the classical computing must include conditional gates that act on two bits, so a working quantum computer needs both single-qubit and two-qubit gates. A quantum CNOT gate is introduced and you will see that it is able to produce entangled states of two qubits.</Paragraph><SubSection id="nonumber-id27"><Title>5.3.1 Two-qubit states</Title><Paragraph>A straightforward way to define the two-qubit states is to build the two-qubit basis states from product states:</Paragraph><Equation><TeX>| \Psi \rangle = | q_1 \rangle | q_2 \rangle = | q_1 q_2 \rangle.</TeX></Equation><Paragraph>There are four possible product states of the usual single-qubit basis states:</Paragraph><Equation><TeX>|00 \rangle, |01 \rangle, |10 \rangle, | 11 \rangle</TeX></Equation><Paragraph>A general two-qubit state, therefore can be expressed in terms the product states as </Paragraph><Equation><TeX>| \Psi \rangle = a_{00} |00 \rangle + a_{01} |01 \rangle + a_{10} |10 \rangle + a_{11} |11 \rangle, </TeX></Equation><Paragraph>where <InlineEquation><TeX>| \Psi \rangle</TeX></InlineEquation> is normalised in the usual way:</Paragraph><Equation><TeX>| a_{00}|^2 + | a_{01}|^2 + | a_{10}|^2 + | a_{11}|^2  =1</TeX><Label>(15)</Label></Equation><Paragraph>To specify the state of the two-qubit system, six real numbers must be given. Counting them in the same way as for a single qubit, these are the eight numbers specifying the real and imaginary parts of each complex number <InlineEquation><TeX>a_{mn}</TeX></InlineEquation> (where the indices are <i>mn</i> = 00, 01, 10, 11). Eight is reduced by one because of the normalisation condition, given in Equation 15 and by one more, to six because the phase of one of the basis states can be set to zero without changing anything physical. </Paragraph><Paragraph>In general, an <i>n</i>-qubit system requires <InlineEquation><TeX>(2^{n+1} - 2)</TeX></InlineEquation> real numbers to specify the state, which is an exponential scaling in the number of qubits.</Paragraph><Paragraph>If  the two-qubit gate <InlineEquation><TeX>\widehat{\mathrm{G}}</TeX></InlineEquation> is an operation, an equation can be written which represents the transformation from a two-qubit state <InlineEquation><TeX>| \Psi \rangle</TeX></InlineEquation> into a new two-qubit state <InlineEquation><TeX>| \Phi \rangle</TeX></InlineEquation>: </Paragraph><Equation><TeX>\widehat{\mathrm{G}} | \Psi \rangle = | \Phi \rangle = b_{00} |00 \rangle + b_{01} |01 \rangle + b_{10} |10 \rangle + b_{11} |11 \rangle.</TeX></Equation><Paragraph>Multiple qubits are represented using the tensor product, which combines their states into a larger system. The resulting matrices represent the full system and can be used to calculate outputs by multiplying them with quantum state vectors. For instance the example above can be written as</Paragraph><Equation><TeX>\begin{bmatrix} g_{00} &amp; g_{01} &amp; g_{02} &amp; g_{03} \\ g_{10} &amp; g_{11} &amp; g_{12} &amp; g_{13} \\ g_{20} &amp; g_{21} &amp; g_{22} &amp; g_{23} \\ g_{30} &amp; g_{31} &amp; g_{32} &amp; g_{33} \end{bmatrix} \begin{bmatrix} a_{00} \\ a_{01} \\ a_{10} \\ a_{11} \end{bmatrix} = \begin{bmatrix} b_{00} \\ b_{01} \\ b_{10} \\ b_{11} \end{bmatrix} </TeX></Equation><Paragraph>This representation shows that a two-qubit gate can be expressed as a 4 &#xD7; 4 matrix with elements <InlineEquation><TeX>g_{ij}</TeX></InlineEquation>, which act on a 4 &#xD7; 1 column vector representing the quantum state. This allows you to compute the output state using matrix multiplication. However, we won&#x2019;t be using this formalism in our discussions, as we will focus on other intuitive approaches to understanding multi-qubit systems and gates.</Paragraph></SubSection><SubSection id="nonumber-id28"><Title>5.3.2 How the CNOT gate works</Title><Paragraph>In the same way as a classical CNOT gate, described in Section 4.2, acts on two bits, a control bit and a target bit; the quantum CNOT gate also acts on two qubits, a control qubit and a target qubit. </Paragraph><Paragraph>The CNOT gate, represented by an operator <InlineEquation><TeX>\widehat{\mathrm{CX}}_{C,T}</TeX></InlineEquation>, acts on a target qubit <InlineEquation><TeX>| \phi_T \rangle</TeX></InlineEquation> depending
 on the state of a control qubit <InlineEquation><TeX>| \psi_C \rangle</TeX></InlineEquation>. Note that the single &#x2018;hat&#x2019; over the <InlineEquation><TeX>\widehat{\mathrm{CX}}</TeX></InlineEquation> operator tells you that this is one operator in contrast to the sequential operators, e.g. <InlineEquation><TeX>\widehat{\mathrm{H}}\widehat{\mathrm{X}}</TeX></InlineEquation> as in Equation 14, which are two operators.</Paragraph><Paragraph> In the following, the two-qubit state is assumed to be the product <InlineEquation><TeX>| \psi \phi \rangle = | \psi \rangle_C | \phi \rangle_T </TeX></InlineEquation>.  </Paragraph><Paragraph>The quantum CNOT gate follows the same rules as the classical CNOT gate: if the state of the control qubit is <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation>, then it leaves the target qubit unchanged. If the state of the control qubit is <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation>, then it applies the NOT gate to the target qubit. Thus the CNOT gate would act on the state <InlineEquation><TeX>| 00 \rangle</TeX></InlineEquation> as follows:</Paragraph><Equation><TeX>\widehat{\mathrm{CX}}_{C,T} | 00 \rangle = | 00 \rangle \quad \text{(state of the target is unchanged)}</TeX></Equation><Paragraph>and on the state <InlineEquation><TeX>| 1 0 \rangle</TeX></InlineEquation> as follows:</Paragraph><Equation><TeX>\widehat{\mathrm{CX}}_{C,T} | 10 \rangle = | 11 \rangle \quad \text{(state of the target is flipped)}</TeX></Equation><Paragraph>The transformations on the kets <InlineEquation><TeX>| 01 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| 11 \rangle</TeX></InlineEquation> can be worked out in the same way. The results of these transformations are collected in the truth table in Table 6 and are identical to the classical rules given in Table 2. </Paragraph><Paragraph>The quantum CNOT gate, however, can also act on superposition states, which is completely beyond the capabilities of the classical CNOT gate. So now consider how the CNOT gate transforms superposition states, starting from the situation where the control state is prepared in the superposition state</Paragraph><Equation><TeX>| \psi \rangle_C = \frac{1}{\sqrt{2}} ( | 0 \rangle_C + | 1 \rangle_C )</TeX><Label>(16)</Label></Equation><Paragraph>and the target qubit is in the state <InlineEquation><TeX>| 0 \rangle_T</TeX></InlineEquation>. First, here is the initial two-qubit state:</Paragraph><Equation><TeX>\begin{split} | \Psi \rangle &amp; = \frac{1}{\sqrt{2}} ( | 0 \rangle_C + | 1 \rangle_C )| 0 \rangle_T \\
&amp; = \frac{1}{\sqrt{2}} ( | 0 \rangle_C | 0 \rangle_T + | 1 \rangle_C | 0 \rangle_T ) \\
&amp; = \frac{1}{\sqrt{2}} ( | 0 0 \rangle + | 1 0 \rangle ) \end{split}.</TeX></Equation><Paragraph>Then applying the CNOT operator gives:</Paragraph><Equation><TeX>\begin{split} \widehat{\mathrm{CX}}_{C,T} | \Psi \rangle &amp; = \widehat{\mathrm{CX}}_{C,T} \frac{1}{\sqrt{2}} ( | 00 \rangle + | 10 \rangle ) \\
&amp; = \frac{1}{\sqrt{2}} \left( \widehat{\mathrm{CX}}_{C,T} | 00 \rangle + \widehat{\mathrm{CX}}_{C,T} | 10 \rangle \right) \\
&amp; = \frac{1}{\sqrt{2}} ( | 00 \rangle + | 11 \rangle ) \end{split}. </TeX></Equation><Paragraph>You can see that the final state is an entangled state because it cannot be factorised. If the control is in the superposition state orthogonal to  the state described in Equation 16, i.e. <InlineEquation><TeX>| \psi \rangle_C = ( |0 \rangle - | 1 \rangle ) / \sqrt{2}</TeX></InlineEquation>, then the negative sign simply propagates so that:</Paragraph><Equation><TeX>\widehat{\mathrm{CX}}_{C,T} \frac{1}{\sqrt{2}} ( | 00 \rangle - | 10 \rangle ) = \frac{1}{\sqrt{2}} ( | 00 \rangle - | 11 \rangle ).</TeX></Equation><Paragraph>The quantum CNOT gate is depicted graphically in Figure 10 and the full CNOT truth table including the quantum-mechanical results is given in Table 6.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_c01_f09.eps.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/sm380_c01_f09.eps.png" width="100%" x_folderhash="865a0355" x_contenthash="c7a19f6d" x_imagesrc="sm380_c01_f09.eps.png" x_imagewidth="142" x_imageheight="94"/><Caption><b>Figure 10</b> The symbol for the quantum CNOT gate, with the control (C) and target (T) qubits labelled</Caption><Description><Paragraph>The figure shows two parallel horiontal lines. The upper one is labelled C and the lower one is labelled T. In the middle of the upper line is a large dot. A vertical line leads from this dot to the lower line where it joins a large circle with a large plus sign in it.</Paragraph></Description></Figure><Table><TableHead><b>Table 6</b> Truth table for the quantum CNOT gate</TableHead><tbody><tr><td borderright="true" borderbottom="true">Input</td><td borderbottom="true">Output</td></tr><tr><td borderright="true"><InlineEquation><TeX>|00 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>|00 \rangle</TeX></InlineEquation></td></tr><tr><td borderright="true"><InlineEquation><TeX>|01 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>|01 \rangle</TeX></InlineEquation></td></tr><tr><td borderright="true"><InlineEquation><TeX>|10 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>|11 \rangle</TeX></InlineEquation></td></tr><tr><td borderright="true"><InlineEquation><TeX>|11 \rangle</TeX></InlineEquation></td><td><InlineEquation><TeX>|10 \rangle</TeX></InlineEquation></td></tr><tr><td borderright="true"><InlineEquation><TeX>\frac{1}{\sqrt{2}} ( | 00  \rangle \pm | 10 \rangle )</TeX></InlineEquation></td><td><InlineEquation><TeX>\frac{1}{\sqrt{2}} ( | 00  \rangle \pm | 11 \rangle )</TeX></InlineEquation></td></tr></tbody></Table><Paragraph>There are other useful states that can be generated using a CNOT gate; another is introduced in the next exercise.</Paragraph><Exercise><Heading>Exercise 15</Heading><Question><Paragraph>Find the two-qubit output state produced by the CNOT operation if the control qubit is prepared in the state <InlineEquation><TeX>| \psi \rangle_C = (| 0 \rangle_C + | 1 \rangle_C)/\sqrt{2}</TeX></InlineEquation>, and the target qubit is prepared in the state <InlineEquation><TeX>| \phi \rangle_T = | 1 \rangle</TeX></InlineEquation>. State whether the output state is entangled or not. </Paragraph></Question><Answer><Paragraph>First, writing the input two-qubit state</Paragraph><Equation><TeX>\begin{split} | \Psi \rangle &amp; = \frac{1}{\sqrt{2}} ( | 0 \rangle_C + | 1 \rangle_C ) | 1 \rangle_T \\
&amp; =  \frac{1}{\sqrt{2}} ( | 0 \rangle_C | 1 \rangle_T + | 1 \rangle_C |1 \rangle_T ) \\
&amp; = \frac{1}{\sqrt{2}} ( | 01 \rangle + | 11 \rangle ) \end{split}. </TeX></Equation><Paragraph>Next, applying the operator:</Paragraph><Equation><TeX>\begin{split} \widehat{\mathrm{CX}}_{C,T} | \Psi \rangle &amp; = \widehat{\mathrm{CX}}_{C,T} |\frac{1}{\sqrt{2}} ( | 01 \rangle + | 11 \rangle ) \\
&amp; = \frac{1}{\sqrt{2}} \left(   \widehat{\mathrm{CX}}_{C,T} | 01 \rangle +  \widehat{\mathrm{CX}}_{C,T} | 11 \rangle \right) \\
&amp; = \frac{1}{\sqrt{2}} ( | 01 \rangle + | 10 \rangle ) \end{split}</TeX></Equation><Paragraph>The output state cannot be factorised so it is an entangled state.</Paragraph></Answer></Exercise><Paragraph>To complete this section, consider the case when one of the entangled outputs from Table 6, <InlineEquation><TeX>| \Phi \rangle_+ = \frac{1}{\sqrt{2}} ( | 00 \rangle + | 11 \rangle )</TeX></InlineEquation> is used as an input state. 
</Paragraph><Equation><TeX>\begin{split} \widehat{\mathrm{CX}}_{C,T} | \Phi \rangle &amp; = \widehat{\mathrm{CX}}_{C,T} |\frac{1}{\sqrt{2}} ( | 00 \rangle + | 11 \rangle ) \\
&amp; = \frac{1}{\sqrt{2}} \left(   \widehat{\mathrm{CX}}_{C,T} | 00 \rangle +  \widehat{\mathrm{CX}}_{C,T} | 11 \rangle \right) \\
&amp; = \frac{1}{\sqrt{2}} ( | 00 \rangle + | 10 \rangle ) = \frac{1}{\sqrt{2}} ( | 0 \rangle_C + | 1 \rangle_C ) | 0 \rangle_T \end{split}</TeX></Equation><Paragraph>The final state is now a product state (i.e. it is <i>disentangled</i>), where the control qubit is in the superposition state <InlineEquation><TeX>(|0 \rangle_C + | 1 \rangle_C)/\sqrt{2}</TeX></InlineEquation>. Thus the CNOT gate can disentangle a pair of qubits as well as entangle them.</Paragraph></SubSection></Section><Section id="nonumber-id29"><Title>5.4 Quantum circuits</Title><Paragraph>In this section, you will make use of what you have already learnt about single-qubit and two-qubit gates to construct and interpret quantum circuits. A quantum circuit performs an algorithm in the sense that it executes a predefined sequence of quantum operations that embody an algorithm&#x2019;s logic. However, unlike classical circuits, quantum circuits rely on principles like superposition and entanglement, and their output is often probabilistic rather than deterministic.</Paragraph><Paragraph>By the end of this section you will be able to predict the outcome of the application of a quantum circuit to a given input state. As well as combining a series of gates, measurements can also be made in quantum circuits when one of the eigenstates of the measurement operator will be obtained with a certain probability. Therefore, the prediction of an output from a quantum circuit may involve more than one possible outcome and the associated probabilities of these outcomes. At the end of this section there is an activity to test your understanding of quantum circuits.</Paragraph><SubSection id="nonumber-id30"><Title>5.4.1 Circuits with multiple gates</Title><Paragraph>Single-qubit gates and two-qubit gates can be combined in a structured sequence to give a quantum circuit containing multiple quantum gates. Consider as an example the circuit shown in Figure 11, which depicts a sequence of gates acting on two qubits, labelled <InlineEquation><TeX>| q_1 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| q_2 \rangle</TeX></InlineEquation>. Remember that each qubit enters its circuit from the left; first, a Hadamard gate is applied to qubit <InlineEquation><TeX>| q_1 \rangle</TeX></InlineEquation>. Then a CNOT is applied to <InlineEquation><TeX>| q_1 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| q_2 \rangle</TeX></InlineEquation>, where the control <i>C</i> is <InlineEquation><TeX>| q_1 \rangle</TeX></InlineEquation> and the target <i>T</i> is <InlineEquation><TeX>| q_2 \rangle</TeX></InlineEquation>. Finally, a NOT gate is applied to <InlineEquation><TeX>| q_2 \rangle</TeX></InlineEquation>. </Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_c01_f10x.eps.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/sm380_c01_f10x.eps.png" width="100%" x_folderhash="865a0355" x_contenthash="6df57e82" x_imagesrc="sm380_c01_f10x.eps.png" x_imagewidth="283" x_imageheight="91"/><Caption><b>Figure 11</b> An example of a quantum circuit with multiple quantum gates</Caption><Description><Paragraph>The figure shows two parallel horiontal lines. The upper one is labelled q1 and the lower one is labelled q2. In the left part of the upper line is a square box with a capital letter H in it. Further along the upper line is a large dot. A vertical line leads from this dot to the lower line where it joins a large circle with a large plus sign in it. to the right of this on the lower line is another large circle with a large plus sign in it.</Paragraph></Description></Figure><Paragraph>The circuit in Figure 11 is a sequence of operations applied to qubits and can be analysed using the methods already introduced, with extra subscripts labelling the single-qubit gates and operations so that the qubit each operation is acting on is clear. Thus <InlineEquation><TeX>\widehat{\mathrm{H}}_1</TeX></InlineEquation> acts only on the qubit <InlineEquation><TeX>q_1</TeX></InlineEquation>, leaving <InlineEquation><TeX>q_2</TeX></InlineEquation> unchanged. Therefore, using <InlineEquation><TeX>| 0 0 \rangle</TeX></InlineEquation> as a sample input the calculation becomes:</Paragraph><Equation><TeX>| q_1 q_2 \rangle_\text{final} = \widehat{\mathrm{X}}_2 \widehat{\mathrm{CX}}_{1,2} \widehat{\mathrm{H}}_1 | 0 0 \rangle.</TeX></Equation><Paragraph>Now <InlineEquation><TeX>\widehat{\mathrm{H}}_1</TeX></InlineEquation> acts only on <InlineEquation><TeX>q_1</TeX></InlineEquation>, so</Paragraph><Equation><TeX>\begin{split} \widehat{\mathrm{H}}_1 | 0 0 \rangle &amp; = \widehat{\mathrm{H}}_1 | 0 \rangle_1 | 0 \rangle_2 \\
&amp; = \frac{1}{\sqrt{2}} ( | 1 \rangle_1 + | 0 \rangle_1 ) | 0 \rangle_2 \\
&amp; = \frac{1}{\sqrt{2}} ( | 10 \rangle + | 00 \rangle ) \end{split}</TeX></Equation><Paragraph>This means that</Paragraph><Equation><TeX>| q_1 q_2 \rangle_\text{final} = \widehat{\mathrm{X}}_2 \widehat{\mathrm{CX}}_{1,2} \frac{1}{\sqrt{2}} (|10 \rangle + | 00 \rangle ).</TeX></Equation><Paragraph>Next comes the effect of the CNOT gate, courtesy of <InlineEquation><TeX>\widehat{\mathrm{CX}}_{1,2}</TeX></InlineEquation> and gives</Paragraph><Equation><TeX>| q_1 q_2 \rangle_\text{final} = \widehat{\mathrm{X}}_2 \frac{1}{\sqrt{2}} (|11 \rangle + | 00 \rangle ).</TeX></Equation><Paragraph>Finally, observe that <InlineEquation><TeX>\widehat{\mathrm{X}}_2 </TeX></InlineEquation> acts on <InlineEquation><TeX>q_2</TeX></InlineEquation> only, so flip <InlineEquation><TeX>q_2</TeX></InlineEquation> of each ket in the superposition: </Paragraph><Equation><TeX>| q_1 q_2 \rangle_\text{final} =  \frac{1}{\sqrt{2}} (|10 \rangle + | 01 \rangle ).</TeX></Equation></SubSection><SubSection id="nonumber-id31"><Title>5.4.2 Measurements</Title><Paragraph>Measurements are different from gate operations in a very important way, since rather than transforming a qubit from one definite state <InlineEquation><TeX>| \Psi \rangle</TeX></InlineEquation> to another definite state <InlineEquation><TeX>| \Phi \rangle</TeX></InlineEquation>, the final state after measurement is one of the two eigenstates of the measurement operator, which are obtained with some probability. Therefore, measurements are not reversible. The results of measurements are real numbers, so they can be stored as bits (rather than qubits) in a modern memory cell. </Paragraph><Paragraph>The circuit symbol for the measurement operation is shown in Figure 12.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_c01_f11.eps.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/sm380_c01_f11.eps.png" width="100%" x_folderhash="865a0355" x_contenthash="a6397076" x_imagesrc="sm380_c01_f11.eps.png" x_imagewidth="172" x_imageheight="38"/><Caption><b>Figure 12</b> The symbol for a measurement operation</Caption><Description><Paragraph>The figure shows a horizontal line. In the middle of the line is a square box. In the box is a curved line and an arrow that resemble a measuring meter.</Paragraph></Description></Figure><Paragraph>The probabilistic nature of measurement is a feature of quantum computing that must be accounted for when evaluating the performance of a quantum algorithm. </Paragraph><Example><Paragraph><b>Example</b></Paragraph><Paragraph>A circuit is set up as shown in Figure 13 and the input qubits are both <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation>. Calculate the output qubits and hence the possible results of the measurements and their probabilities.
</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/sm380_c01_f12.eps.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/sm380_c01_f12.eps.png" width="100%" x_folderhash="865a0355" x_contenthash="38f5ac3e" x_imagesrc="sm380_c01_f12.eps.png" x_imagewidth="331" x_imageheight="106"/><Caption><b>Figure 13</b> A circuit incorporating both a single-qubit and a two-qubit gate</Caption><Description><Paragraph>The figure shows two parallel horiontal lines. The upper one is labelled q1 and the lower one is labelled q2. In the middle of the upper line is a large circle with a large plus sign in it. Further along the upper line is a square box with a curved line and an arrow in it. A vertical line leads from the large circle on the upper line to the lower line where it joins a large dot. To the left of this on the lower line a square box with a capital H in it; to the right of the large dot on the lower line is a square box with a curved line and an arrow in it.</Paragraph></Description></Figure><Answer><Paragraph>Writing the sequence of operations applied to the input qubits and using subscripts to label the qubits and the operations to show which qubit the gates are operating on, gives</Paragraph><Equation><TeX>| q_1 q_2 \rangle_\text{final} = \widehat{\mathrm{CX}}_{2,1} \widehat{\mathrm{H}}_2| 1 1 \rangle.</TeX></Equation><Paragraph><InlineEquation><TeX>\widehat{\mathrm{H}}_2</TeX></InlineEquation> acts on <InlineEquation><TeX>q_2</TeX></InlineEquation> so</Paragraph><Equation><TeX>\begin{split} \widehat{\mathrm{H}}_2 | 1 1 \rangle &amp; = \widehat{\mathrm{H}}_2 | 1\rangle_1 | 1 \rangle_2 = | 1 \rangle_1 \widehat{\mathrm{H}}_2 | 1 \rangle_2 \\
 &amp; = | 1 \rangle_1 \frac{1}{\sqrt{2}} ( | 0 \rangle_2 - | 1 \rangle_2 ) \\
&amp; = \frac{1}{\sqrt{2}} | 1 \rangle (| 0 \rangle - | 1 \rangle ) \end{split}</TeX></Equation><Paragraph>so now</Paragraph><Equation><TeX>| q_1 q_2 \rangle_\text{final} = \widehat{\mathrm{CX}}_{2,1} \frac{1}{\sqrt{2}} | 1 \rangle (| 0 \rangle - | 1 \rangle ) </TeX></Equation><Paragraph>Note that <InlineEquation><TeX>q_2</TeX></InlineEquation> is the control qubit and <InlineEquation><TeX>q_1</TeX></InlineEquation> is the target qubit. Consequently, when <InlineEquation><TeX>\widehat{\mathrm{CX}}_{2,1}</TeX></InlineEquation> operates on <InlineEquation><TeX>| q_1 q_2 \rangle</TeX></InlineEquation>, look at <InlineEquation><TeX>| q_2 \rangle</TeX></InlineEquation> to decide whether <InlineEquation><TeX>| q_1 \rangle</TeX></InlineEquation> is flipped. Again, adding subscripts to identify the qubits,</Paragraph><Equation><TeX>\begin{split}
| q_1 q_2 \rangle_\text{final} &amp; = \frac{1}{\sqrt{2}} \widehat{\mathrm{CX}}_{1,2} ( | 1 \rangle_1 | 0 \rangle_2 - | 1 \rangle_1 | 1 \rangle_2 ) \\
&amp; = \frac{1}{\sqrt{2}} \left(  \widehat{\mathrm{CX}}_{1,2} (| 1 \rangle_1 | 0 \rangle_2 - \widehat{\mathrm{CX}}_{1,2} | 1 \rangle_1 | 1 \rangle_2 \right) \\
&amp; = \frac{1}{\sqrt{2}}( | 1 \rangle_1 | 0 \rangle_2 - | 0 \rangle_1 | 1 \rangle_2 )  \\
&amp; = \frac{1}{\sqrt{2}} | 1 \rangle | 0 \rangle - \frac{1}{\sqrt{2}} | 0 \rangle| 1 \rangle \end{split}</TeX></Equation><Paragraph>
This is the final state which is measured. It is an entangled state. There are two possible outcomes; either <InlineEquation><TeX>q_1</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>q_2</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation> or <InlineEquation><TeX>q_1</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>q_2</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation>. From the <InlineEquation><TeX>1/\sqrt{2}</TeX></InlineEquation> coefficients, the conclusion is that each outcome has a probability of 1/2. </Paragraph></Answer></Example></SubSection><SubSection id="nonumber-id32"><Title>5.4.3 Activity</Title><Paragraph>This activity is in two parts. In the first, you are given a quantum circuit and input qubits. Your task is to work out the output qubits and to determine whether the final output states, before measurements are taken, are entangled. In the second task you will design your own circuit for given input and output qubits. </Paragraph><Example><Paragraph><b>Part 1</b></Paragraph><Paragraph>Consider the quantum circuit shown in Figure 14. The input qubits are both <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation>. Determine if the output two-qubit state, before measurements are taken, is entangled. Calculate the possible measurements and the probability of each possibility.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/activity_circuit1.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/activity_circuit1.png" width="100%" x_folderhash="865a0355" x_contenthash="fdaea808" x_imagesrc="activity_circuit1.png" x_imagewidth="331" x_imageheight="106"/><Caption><b>Figure 14</b> A circuit to be analysed for the Activity</Caption><Description><Paragraph>The figure shows two parallel horiontal lines. The upper one is labelled q1 and the lower one is labelled q2. Near the left end of both lines are square boxes each containing a capital letter H. Further along the upper line is a large dot. A vertical line leads from this dot to the lower line where it joins a large circle with a large plus sign in it. Still further along the upper line is a large circle with a large plus sign in it. Even further along the upper line is another large circle with a large plus sign in it. A vertical line leads from this circle to the lower line where it joins a large dot.  Near the right hand ends of both the upper and lower lines are square boxes each with a curved line and an arrow in it.</Paragraph></Description></Figure><Answer><Paragraph>Writing the sequence of operations applied to the input qubits and using subscripts to label the qubits and the operations to show which qubit the gates are operating on, gives</Paragraph><Equation><TeX>| q_1 q_2 \rangle_\text{final} =  \widehat{\mathrm{CX}}_{2,1} \widehat{\mathrm{X}}_1 \widehat{\mathrm{CX}}_{1,2} \widehat{\mathrm{H}}_2 \widehat{\mathrm{H}}_1| 0 0 \rangle.</TeX></Equation><Paragraph><InlineEquation><TeX>\widehat{\mathrm{H}}_1</TeX></InlineEquation> acts on <InlineEquation><TeX>q_1</TeX></InlineEquation> and <InlineEquation><TeX>\widehat{\mathrm{H}}_2</TeX></InlineEquation> acts on <InlineEquation><TeX>q_2</TeX></InlineEquation>. So looking first at <InlineEquation><TeX>q_1,</TeX></InlineEquation></Paragraph><Equation><TeX>\widehat{\mathrm{H}}_1 | 0 \rangle_1  = \frac{1}{\sqrt{2}} ( | 0 \rangle_1 + | 1 \rangle_1 ) </TeX></Equation><Paragraph>So <InlineEquation><TeX>q_1</TeX></InlineEquation> is now in a superposition state. The effect on <InlineEquation><TeX>q_2</TeX></InlineEquation> is similar, </Paragraph><Equation><TeX>\widehat{\mathrm{H}}_2 | 0 \rangle_2  = \frac{1}{\sqrt{2}} ( | 0 \rangle_2 + | 1 \rangle_2 ) </TeX></Equation><Paragraph>and <InlineEquation><TeX>q_2</TeX></InlineEquation> is also in a superposition state. So now we have</Paragraph><Equation><TeX>\begin{split} | q_1 q_2 \rangle_\text{final} &amp; = \widehat{\mathrm{CX}}_{2,1} \widehat{\mathrm{X}}_1  \widehat{\mathrm{CX}}_{1,2}  \frac{1}{\sqrt{2}} ( | 0 \rangle_1 + | 1 \rangle_1 ) \frac{1}{\sqrt{2}} ( | 0 \rangle_2 + | 1 \rangle_2 )  \\
 &amp; =  \widehat{\mathrm{CX}}_{2,1} \widehat{\mathrm{X}}_1 \widehat{\mathrm{CX}}_{1,2} \frac{1}{2} ( |0\rangle_1 |0 \rangle_2 + |0\rangle_1 |1 \rangle_2 + |1 \rangle_1 |0 \rangle_2 + |1 \rangle_1 |1 \rangle_2) \end{split} </TeX></Equation><Paragraph>Note that for the first CNOT gate, <InlineEquation><TeX>q_1</TeX></InlineEquation> is the control qubit and <InlineEquation><TeX>q_2</TeX></InlineEquation> is the target qubit. Consequently, when <InlineEquation><TeX>\widehat{\mathrm{CX}}_{1,2}</TeX></InlineEquation> operates on <InlineEquation><TeX>| q_1 q_2 \rangle</TeX></InlineEquation>, look at <InlineEquation><TeX>| q_1 \rangle</TeX></InlineEquation> to decide whether <InlineEquation><TeX>| q_2 \rangle</TeX></InlineEquation> is flipped. Again, adding subscripts to identify the qubits,</Paragraph><Equation><TeX>\widehat{\mathrm{CX}}_{1,2} ( |0\rangle_1 |0 \rangle_2 + |0\rangle_1 |1 \rangle_2 + |1 \rangle_1 |0 \rangle_2 + |1 \rangle_1 |1 \rangle_2)  = ( |0\rangle_1 |0 \rangle_2 + |0\rangle_1 |1 \rangle_2 + |1 \rangle_1 |1 \rangle_2 + |1 \rangle_1 |0 \rangle_2) </TeX></Equation><Paragraph>The result is an entangled state. Next the NOT gate acts on qubit <InlineEquation><TeX>q_1</TeX></InlineEquation> to give</Paragraph><Equation><TeX>\widehat{\mathrm{X}}_1( |0\rangle_1 |0 \rangle_2 + |0\rangle_1 |1 \rangle_2 + |1 \rangle_1 |1 \rangle_2 + |1 \rangle_1 |0 \rangle_2) = ( |1\rangle_1 |0 \rangle_2 + |1\rangle_1 |1 \rangle_2 + |0 \rangle_1 |1 \rangle_2 + |0 \rangle_1 |0 \rangle_2)</TeX></Equation><Paragraph>So we now have </Paragraph><Equation><TeX>  | q_1 q_2 \rangle_\text{final}  = \frac{1}{2} \widehat{\mathrm{CX}}_{2,1} ( |1\rangle_1 |0 \rangle_2 + |1\rangle_1 |1 \rangle_2 + |0 \rangle_1 |1 \rangle_2 + |0 \rangle_1 |0 \rangle_2)</TeX></Equation><Paragraph>The second CNOT gate acts on <InlineEquation><TeX>q_2</TeX></InlineEquation> as the control qubit and <InlineEquation><TeX>q_1</TeX></InlineEquation> as the target qubit, so this time look at <InlineEquation><TeX>| q_2 \rangle</TeX></InlineEquation> to decide whether <InlineEquation><TeX>| q_1 \rangle</TeX></InlineEquation> is flipped. </Paragraph><Equation><TeX> \widehat{\mathrm{CX}}_{2,1} ( |1\rangle_1 |0 \rangle_2 + |1\rangle_1 |1 \rangle_2 + |0 \rangle_1 |1 \rangle_2 + |0 \rangle_1 |0 \rangle_2) = ( |1\rangle_1 |0 \rangle_2 + |0\rangle_1 |1 \rangle_2 + |1 \rangle_1 |1 \rangle_2 + |0 \rangle_1 |0 \rangle_2)</TeX></Equation><Paragraph>So we finally have the following,</Paragraph><Equation><TeX>  | q_1 q_2 \rangle_\text{final}  = \frac{1}{2} ( |1 0 \rangle + |0 1 \rangle + |1 1 \rangle + |0 0 \rangle)</TeX></Equation><Paragraph>
This is the final state which is measured. It is an entangled state. There are <i>four</i> possible outcomes; either <InlineEquation><TeX>q_1</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>q_2</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation> or <InlineEquation><TeX>q_1</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>q_2</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation> or <InlineEquation><TeX>q_1</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>q_2</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation> or <InlineEquation><TeX>q_1</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>q_2</TeX></InlineEquation> is measured as <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation>. From the <InlineEquation><TeX>1/2</TeX></InlineEquation> coefficients, the conclusion is that each outcome has a probability of 1/4. </Paragraph></Answer></Example><Example><Paragraph><b>Part 2</b></Paragraph><Paragraph>Design a circuit to convert the two-qubit input state <InlineEquation><TeX>|00\rangle</TeX></InlineEquation> into the (non-entangled) superposition two qubit output state comprising <InlineEquation><TeX>|01\rangle</TeX></InlineEquation> and <InlineEquation><TeX>|11\rangle</TeX></InlineEquation> with equal probability.</Paragraph><Answer><Paragraph>There are various ways to achieve this. Once such circuit is shown in Figure 15.</Paragraph><Figure><Image src="https://www.open.edu/openlearn/pluginfile.php/4593899/mod_oucontent/oucontent/146287/activity_circuit2.png" src_uri="file:////openuniv.sharepoint.com@SSL/DavWWWRoot/sites/smodules/sm380/lmimages/activity_circuit2.png" width="100%" x_folderhash="865a0355" x_contenthash="83d34852" x_imagesrc="activity_circuit2.png" x_imagewidth="331" x_imageheight="106"/><Caption><b>Figure 15</b>  A circuit to convert the two-qubit input state <InlineEquation><TeX>|00\rangle</TeX></InlineEquation> into the two qubit output state <InlineEquation><TeX>|01 \rangle</TeX></InlineEquation> or <InlineEquation><TeX>|11\rangle</TeX></InlineEquation> with equal probability</Caption><Description><Paragraph>The figure shows two parallel horiontal lines. The upper one is labelled q1 and the lower one is labelled q2. Near the left end of the lower line is a large circle containing a large plus sign. Near the left end of the upper line is a square box containing a capital letter H.</Paragraph></Description></Figure><Paragraph>The circuit can be described as</Paragraph><Equation><TeX>| q_1 q_2 \rangle_\text{final} =   \widehat{\mathrm{H}}_1 \widehat{\mathrm{X}}_2 | 0 0 \rangle.</TeX></Equation><Paragraph>Starting with input <InlineEquation><TeX>|00 \rangle</TeX></InlineEquation> the circuit applies a NOT gate to qubit <InlineEquation><TeX>q_2</TeX></InlineEquation>, resulting in <InlineEquation><TeX>|01\rangle</TeX></InlineEquation>, so we have</Paragraph><Equation><TeX>| q_1 q_2 \rangle_\text{final} =  \widehat{\mathrm{H}}_1  | 0 1 \rangle.</TeX></Equation><Paragraph>A Hadamard gate is then applied to qubit <InlineEquation><TeX>q_1</TeX></InlineEquation> to create a superposition for this qubit, </Paragraph><Equation><TeX> \widehat{\mathrm{H}}_1  | 0 \rangle_1 = \frac{1}{\sqrt{2}}(|0\rangle_1 + |1 \rangle_1)</TeX></Equation><Paragraph>This gives</Paragraph><Equation><TeX>|q_1 q_2 \rangle_\text{final} = \frac{1}{\sqrt{2}} ( | 01 \rangle + | 11 \rangle )</TeX></Equation><Paragraph>The output state is therefore a state whose non-entangled two qubit  output state is a superposition of <InlineEquation><TeX>|01\rangle</TeX></InlineEquation> and <InlineEquation><TeX>|11\rangle</TeX></InlineEquation> with equal probability, as required.</Paragraph></Answer></Example></SubSection></Section></Session><Session id="nonumber-id33"><Title>6 Real-world quantum computing</Title><Paragraph>
Quantum computing presents enormous technical challenges, which is why there many research groups and companies working on quantum computers and many competing technologies. Each of these technologies has its advantages and disadvantages. 
</Paragraph><Paragraph>Even though large systems are built of atoms and molecules that are well-described by quantum mechanics, large complicated systems such as computers or people don&#x2019;t exhibit the quintessential quantum behaviour such as superposition or entanglement. </Paragraph><Section id="nonumber-id34"><Title>6.1 Schr&#xF6;dinger&#x2019;s cat</Title><Paragraph>A famous statement of this idea was given by Erwin Schr&#xF6;dinger in his Schr&#xF6;dinger&#x2019;s cat thought experiment. In that thought experiment, the fate of a cat in an enclosed box depends on the disintegration of a single radioactive nucleus, which, when it decays, will trigger the release of poison and thereby the death of the cat. The nucleus is supposed to be in the superposition state</Paragraph><Equation><TeX>| \text{nucleus} \rangle = a_0 | \text{metastable} \rangle + a_1 | \text{stable} \rangle</TeX></Equation><Paragraph>
If the possible states for the cat are <InlineEquation><TeX>| \text{dead} \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| \text{alive} \rangle</TeX></InlineEquation>, then the total state for the system of cat and nucleus is
</Paragraph><Equation><TeX>| \text{cat + nucleus} \rangle = a_0 | \text{metastable} \rangle | \text{alive} \rangle  + a_1 | \text{stable} \rangle | \text{dead} \rangle</TeX><Label>(17)</Label></Equation><Paragraph>
The cat is entangled with the nucleus, since there exists a correlation between the state of the nucleus and the state of the cat (the state written down in Equation 17 is an entangled state). </Paragraph><Paragraph>The point of the thought experiment is that it demonstrates that thinking of the nucleus + cat system as a superposition of those extreme states is absurd. </Paragraph><Paragraph>Surely it&#x2019;s absurd to believe that a cat is well-described by a state vector (<InlineEquation><TeX>| \text{alive} \rangle</TeX></InlineEquation> or <InlineEquation><TeX>| \text{dead} \rangle</TeX></InlineEquation>), and surely the cat is in the definite state &#x2018;alive&#x2019;until it definitely dies (or better, until the experiment is stopped before the cat is killed). </Paragraph><Paragraph>The issue at hand is that a useful working quantum computer containing hundreds of thousands of qubits would be more akin to Schr&#xF6;dinger&#x2019;s cat than a single quantum object, like a solitary microscopic superconducting circuit.</Paragraph></Section><Section id="nonumber-id35"><Title>6.2 A few examples of quantum technologies</Title><Paragraph>This section is to provide you with a starting point if you would like to learn more about quantum computer technologies. The difficulties of quantum computing means that the number of systems that have been proposed as quantum computers is almost as large as the number of tasks in which quantum computers can (in principle) outperform classical computers. In this section there is a brief introduction to three, the transmon qubit, NMR and cold atom technology. It is not possible to expect this section to keep up-to-date as advances are being made all the time and often announcements appear in the news.  You can watch out for these and follow up your interests if you would like to. Some links are provided at the end to get you started.</Paragraph><Paragraph><b>The transmon qubit</b></Paragraph><Paragraph>The transmon qubit is based on a miniaturised superconducting circuit, built from a capacitor and a non-linear inductor called a Josephson junction. This qubit is at the heart of the IBM quantum computers, which makes it one of the most advanced platforms. </Paragraph><Paragraph>Within superconducting circuits, quantum logic gates may be implemented by applying an AC voltage to the qubits. The qubits in the superconductor involve the charge carriers which respond to the applied potential.</Paragraph><Paragraph><b>The NMR qubit</b></Paragraph><Paragraph>NMR was used as an early test of quantum computing because the technology is well-developed as a result of medical research and its use for medical purposes (MRI scanners). In NMR quantum computing, each qubit is realised as a collection of particles called an ensemble. The ensemble is all the molecules in a sample. The qubits are molecular sites in the target molecule. Therefore, the sample contains many copies of the qubits. To increase the number of qubits, the molecule must become more complex, but this is difficult because as the size of the molecule increases, environmental effects mean that each molecule is likely to be different. This leads to the conclusion that NMR quantum computing is limited to about 20 qubits and it is unlikely that this number of qubits can be increased.  </Paragraph><Paragraph><b>Using cold-atom technology</b></Paragraph><Paragraph>Cold-atom technology (which includes cold ions) is able to take advantage of techniques developed to build atomic clocks. The appeal of cold-atom systems is the degree of control that can be achieved. For example, from the gas phase, individual atoms can be trapped at specific sites in a vacuum chamber, and then addressed by individual laser beams for the purposes of implementing gates or measurements. The weakness of the cold-atom approach is that, so far, its complexity scales poorly with the number of qubits. </Paragraph><Paragraph><b>Links</b></Paragraph><Paragraph>Here are some links to websites that explain current activities in quantum computing from different companies.</Paragraph><Paragraph><a href="https://www.ibm.com/quantum/technology">IBM</a><a href="https://www.ibm.com/quantum/technology">https://www.ibm.com/quantum/technology</a></Paragraph><Paragraph><a href="https://aws.amazon.com/what-is/quantum-computing">Amazon</a><a href="https://aws.amazon.com/what-is/quantum-computing">https://aws.amazon.com/what-is/quantum-computing</a></Paragraph><Paragraph><a href="https://thequantuminsider.com/2023/06/06/types-of-quantum-computers">Quantum Insider</a><a href="https://thequantuminsider.com/2023/06/06/types-of-quantum-computers">https://thequantuminsider.com/2023/06/06/types-of-quantum-computers</a></Paragraph><Paragraph><a href="https://www.xanadu.ai/photonics/">Xanadu AI</a> and <a href="https://www.xanadu.ai/photonics/">From a state of light to state of the art</a> </Paragraph><Paragraph><a href="https://quantumai.google/">Google Quantum AI</a> and <a href="https://blog.google/technology/ai/what-our-quantum-computing-milestone-means/">What our quantum computing milestone means</a> or </Paragraph><Paragraph><a href="https://quantum.microsoft.com/en-us/explore/concepts/topological-qubits">Microsoft</a><a href="https://quantum.microsoft.com/en-us/explore/concepts/topological-qubits">https://quantum.microsoft.com/en-us/explore/concepts/topological-qubits</a> </Paragraph></Section></Session><Session id="nonumber-id36"><Title>7 Summary</Title><Paragraph>In this course you have learnt the fundamentals of quantum computing.The key points are as follows.</Paragraph><NumberedList><ListItem><Paragraph>Quantum computers may be able solve problems more quickly than classical computers if problem solving algorithms which have exponential run-times on a classical computer can be written to have polynomial run-times on a quantum computer.</Paragraph></ListItem><ListItem><Paragraph>For a given square matrix, <InlineEquation><TeX>\mathrm{A}</TeX></InlineEquation>, it is possible to solve the equation <InlineEquation><TeX>  \mathrm{A}\mathbf{v}= \lambda \mathbf{v}  </TeX></InlineEquation> where <InlineEquation><TeX>\mathbf{v}</TeX></InlineEquation> are column vectors known as <GlossaryTerm>eigenvectors</GlossaryTerm> and <InlineEquation><TeX>\lambda</TeX></InlineEquation> is a scalar called an <GlossaryTerm>eigenvalue</GlossaryTerm>. In quantum mechanics, an <GlossaryTerm>operator</GlossaryTerm> is a mathematical entity which converts one function into another function. Given an operator <InlineEquation><TeX>\mathrm{\widehat{A}}</TeX></InlineEquation>, the eigenvalue equation for that operator is <InlineEquation><TeX>    \mathrm{\widehat{A}}f(x)= \lambda f(x)</TeX></InlineEquation>. Here, the eigenvalue <InlineEquation><TeX>\lambda</TeX></InlineEquation> may be a complex number, and <InlineEquation><TeX>f(x)</TeX></InlineEquation> is function known as an <GlossaryTerm>eigenfunction</GlossaryTerm>. There may be more than one eigenvalue and corresponding eigenfunction associated with each eigenvalue equation.</Paragraph></ListItem><ListItem><Paragraph>A general spin state <InlineEquation><TeX>| A \rangle</TeX></InlineEquation> (known as a <GlossaryTerm>ket</GlossaryTerm>) can be written as a linear combination of a spin-up state <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and a spin-down state <InlineEquation><TeX>| \downarrow  \rangle</TeX></InlineEquation> (known as <GlossaryTerm>basis vectors</GlossaryTerm>), thus <InlineEquation><TeX>| A \rangle = a_1 | \uparrow \rangle + a_2 | \downarrow \rangle</TeX></InlineEquation> where <InlineEquation><TeX>a_1</TeX></InlineEquation> and <InlineEquation><TeX>a_2</TeX></InlineEquation> are complex numbers. For an atom in any spin state, <InlineEquation><TeX>| A \rangle</TeX></InlineEquation>, the probability of the outcome of a measurement indicating spin-up is <InlineEquation><TeX>| a_1 |^2</TeX></InlineEquation> and for spin-down is <InlineEquation><TeX>|a_2|^2</TeX></InlineEquation>. Since these are the only possible outcomes the corresponding probabilities must sum to one, therefore <InlineEquation><TeX> |a_1|^2+|a_2|^2=1.</TeX></InlineEquation></Paragraph></ListItem><ListItem><Paragraph>Matrices can be used as an alternative representation of spin states to simplify calculations. <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| \downarrow \rangle</TeX></InlineEquation> are represented by the following column vectors:</Paragraph><Equation><TeX>| \uparrow \rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \quad \text{and} \quad | \downarrow \rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix} </TeX></Equation><Paragraph>Any vector <InlineEquation><TeX>| A \rangle</TeX></InlineEquation> in spin space may be written as a linear combination of <InlineEquation><TeX>| \uparrow \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| \downarrow \rangle</TeX></InlineEquation>. This means that <InlineEquation><TeX>| A \rangle</TeX></InlineEquation> becomes:</Paragraph><Equation><TeX>| A \rangle = a_1 \begin{bmatrix} 1 \\ 0 \end{bmatrix}  + a_2 \begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} a_1 \\ a_2 \end{bmatrix}  </TeX></Equation><Paragraph> In this way any spin state of a spin-&#xBD; particle can be represented as a two-element matrix, which is called a <GlossaryTerm>spinor</GlossaryTerm>.</Paragraph></ListItem><ListItem><Paragraph>For two electrons, the two-particle spin state can have an overall spin function which is either symmetric or antisymmetric to exchange of electrons. There is a set of triplet states and a singlet state, as follows:</Paragraph><Equation><TeX>\begin{split} | 1, 1 \rangle &amp; = | \uparrow \uparrow \rangle , \\
 |  1,  0 \rangle &amp; = \frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle + | \downarrow \uparrow \rangle ), \\
 |  1,  -1 \rangle &amp; = | \downarrow \downarrow \rangle, \\
|  0,  0 \rangle  &amp; = \frac{1}{\sqrt{2}} ( | \uparrow \downarrow \rangle - | \downarrow \uparrow \rangle ). \end{split}</TeX></Equation><Paragraph>where the first arrow in each ket refers to particle 1 and the second to particle 2.  The triplet states are symmetric and the singlet state is antisymmetric under particle exchange. Two-particle states which <i>cannot</i> be factorised (i.e. <InlineEquation><TeX>| 0,0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| 1, 0 \rangle</TeX></InlineEquation>) are known as <GlossaryTerm>entangled states</GlossaryTerm> and exhibit <GlossaryTerm>entanglement</GlossaryTerm>. The other states 
(i.e. <InlineEquation><TeX>| 1,1 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| 1, -1 \rangle</TeX></InlineEquation>) are not entangled.</Paragraph></ListItem><ListItem><Paragraph>Quantum computing is based on units of information called <GlossaryTerm>qubits</GlossaryTerm> (quantum bits, and pronounced <i>kew-bits</i>), which obey the laws of quantum mechanics. A qubit is the quantum analogue of a classical bit. The classical bit values 0 and 1 are replaced by the orthonormal basis states of the quantum-mechanical qubit <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>| 1 \rangle</TeX></InlineEquation>. The basis states are given the name <GlossaryTerm>logical states</GlossaryTerm> , since they correspond to the classical bits upon which the logic gates operate. The key difference between qubits and classical bits is that qubits can exist in a superposition of the <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation>  and <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation>states, which means qubits can be prepared in the superposition state <InlineEquation><TeX>| \psi \rangle = a_0 | 0 \rangle + a_1 | 1 \rangle</TeX></InlineEquation>.</Paragraph></ListItem><ListItem><Paragraph>The  quantum <GlossaryTerm>NOT gate</GlossaryTerm> is denoted by the operator, <InlineEquation><TeX>\widehat{\mathrm{X}}</TeX></InlineEquation> and, in the basis of the logical qubits <InlineEquation><TeX>|0 \rangle</TeX></InlineEquation> and <InlineEquation><TeX>|1 \rangle</TeX></InlineEquation>, is represented by the matrix:</Paragraph><Equation><TeX>\widehat{\mathrm{X}} = \begin{bmatrix} 0 &amp; 1 \\ 1 &amp; 0 \end{bmatrix}.</TeX></Equation><Paragraph>which is also the Pauli-<i>X</i> operator, <InlineEquation><TeX>\widehat{\sigma}_x</TeX></InlineEquation>. If the input to a quantum NOT gate is <InlineEquation><TeX>a_0 |0 \rangle  + a_1 | 1 \rangle</TeX></InlineEquation> then the output is <InlineEquation><TeX>a_0 |1 \rangle  + a_1 | 0 \rangle</TeX></InlineEquation>.</Paragraph></ListItem><ListItem><Paragraph>    The <GlossaryTerm>Hadamard gate</GlossaryTerm> is a single-qubit gate defined by the matrix:</Paragraph><Equation><TeX>\widehat{\mathrm{H}} = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; -1 \end{bmatrix}.</TeX></Equation><Paragraph>If the input to a Hadamard gate is <InlineEquation><TeX>a_0 |0 \rangle  + a_1 | 1 \rangle</TeX></InlineEquation> then the output is <InlineEquation><TeX>\frac{1}{\sqrt{2}} ( a_0 + a_1) | 0 \rangle + \frac{1}{\sqrt{2}} ( a_0 - a_1) | 1 \rangle </TeX></InlineEquation>. A Hadamard gate allows the transformation of the logical qubit state into a <i>superposition</i> state.</Paragraph></ListItem><ListItem><Paragraph>A straightforward way to define the <GlossaryTerm>two-qubit states</GlossaryTerm> is to build the two-qubit basis states from product states <InlineEquation><TeX>| \Psi \rangle = | q_1 \rangle | q_2 \rangle = | q_1 q_2 \rangle</TeX></InlineEquation>. There are four possible product states of the usual single-qubit basis states: <InlineEquation><TeX>|00 \rangle, |01 \rangle, |10 \rangle, | 11 \rangle</TeX></InlineEquation>. A general two-qubit state, therefore can be expressed in terms of the product states as </Paragraph><Equation><TeX>| \Psi \rangle = a_{00} |00 \rangle + a_{01} |01 \rangle + a_{10} |10 \rangle + a_{11} |11 \rangle, </TeX></Equation><Paragraph>where <InlineEquation><TeX>| \Psi \rangle</TeX></InlineEquation> is normalised in the usual way:</Paragraph><Equation><TeX>| a_{00}|^2 + | a_{01}|^2 + | a_{10}|^2 + | a_{11}|^2  =1</TeX></Equation></ListItem><ListItem><Paragraph>The quantum <GlossaryTerm>CNOT gate</GlossaryTerm> acts on two qubits, a control qubit and a target qubit. It is represented by an operator <InlineEquation><TeX>\widehat{\mathrm{CX}}_{C,T}</TeX></InlineEquation> which acts on a target qubit <InlineEquation><TeX>| \phi_T \rangle</TeX></InlineEquation> depending on the state of a control qubit <InlineEquation><TeX>| \psi_C \rangle</TeX></InlineEquation>.  If the input to a CNOT gate is <InlineEquation><TeX>\frac{1}{\sqrt{2}} ( | 00  \rangle \pm | 10 \rangle )</TeX></InlineEquation> then the output is <InlineEquation><TeX>\frac{1}{\sqrt{2}} ( | 00  \rangle \pm | 11 \rangle )</TeX></InlineEquation>. The CNOT gate can <i>entangle</i> a pair of disentangled qubits and can also <i>disentangle</i> a pair of entangled qubits. </Paragraph></ListItem><ListItem><Paragraph>Single-qubit gates and two-qubit gates can be combined in a structured sequence to give a quantum circuit that executes a particular algorithm. Measurements can also be made in quantum circuits when one of the eigenstates of the measurement operator will be obtained with a certain probability. </Paragraph></ListItem><ListItem><Paragraph>Real-world quantum computing has been impemented on platforms including the transmon qubit (as in the IBM quantum computers), the NMR qubit (based on technology used in MRI scanners), and using ultra-cold atom technology. </Paragraph></ListItem></NumberedList></Session><Session><Title><Number>8</Number> Quiz</Title><Paragraph>Answer the following questions in order to test your understanding of the key ideas that you have been learning about.</Paragraph><SAQ><Heading>Question 1</Heading><Question><Paragraph>Which of the following statements about eigenvalues, eigenstates, eigenvectors and eigenfunctions are <i>true</i>?</Paragraph></Question><Interaction><MultipleChoice><Right><Paragraph> An eigenfunction is special type of function that remains essentially unchanged (except for a scaling factor) when acted upon by a given linear operator.</Paragraph><Feedback><Paragraph>True</Paragraph></Feedback></Right><Right><Paragraph>An eigenstate in quantum mechanics is a special quantum state that remains unchanged, except for a multiplicative factor, when a specific quantum operator acts on it.</Paragraph><Feedback><Paragraph>True</Paragraph></Feedback></Right><Right><Paragraph>An eigenvalue is a special scalar associated with a linear transformation of a square matrix. It represents how much a given vector is scaled when that matrix is applied to it.</Paragraph><Feedback><Paragraph>True</Paragraph></Feedback></Right><Right><Paragraph>An eigenstate is a state for which the outcome of a measurement of a certain observable (like energy, position, or momentum) will always yield a specific, definite value.</Paragraph><Feedback><Paragraph>True</Paragraph></Feedback></Right><Right><Paragraph>An eigenvector of a square matrix is a nonzero vector that gets scaled by a certain value when the matrix is applied to it. </Paragraph><Feedback><Paragraph>True</Paragraph></Feedback></Right><Wrong><Paragraph>There is always only one eigenvalue and corresponding eigenfunction associated with each eigenvalue equation</Paragraph><Feedback><Paragraph>False</Paragraph></Feedback></Wrong></MultipleChoice></Interaction><Answer><Paragraph>The first five statements are all true. The last one is false: there may be more than one eigenvalue and corresponding eigenfunction associated with each eigenvalue equation.</Paragraph></Answer></SAQ><SAQ><Heading>Question 2</Heading><Question><Paragraph>What are the eigenvalues and eigenvectors of the following matrix?</Paragraph><Equation><TeX>\begin{bmatrix} 7 &amp; 4 \\ 2 &amp; 5 \end{bmatrix}</TeX></Equation></Question><Interaction><SingleChoice><Wrong><Paragraph>For eigenvalue <InlineEquation><TeX>\lambda_1 = 7</TeX></InlineEquation> the eigenvector is <InlineEquation><TeX>\mathbf{v}_1 = \begin{bmatrix} 1 \\ 1 \end{bmatrix}</TeX></InlineEquation> and for eigenvalue <InlineEquation><TeX>\lambda_2 = 5</TeX></InlineEquation> the eigenvector is <InlineEquation><TeX>\mathbf{v}_2 = \begin{bmatrix} -2 \\ 1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong><Right><Paragraph>For eigenvalue <InlineEquation><TeX>\lambda_1 = 9</TeX></InlineEquation> the eigenvector is <InlineEquation><TeX>\mathbf{v}_1 = \begin{bmatrix} 2 \\ 1 \end{bmatrix}</TeX></InlineEquation> and for eigenvalue <InlineEquation><TeX>\lambda_2 = 3</TeX></InlineEquation> the eigenvector is <InlineEquation><TeX>\mathbf{v}_2 = \begin{bmatrix} -1 \\ 1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Right><Wrong><Paragraph>For eigenvalue <InlineEquation><TeX>\lambda_1 = 4</TeX></InlineEquation> the eigenvector is <InlineEquation><TeX>\mathbf{v}_1 = \begin{bmatrix} 2 \\ 2 \end{bmatrix}</TeX></InlineEquation> and for eigenvalue <InlineEquation><TeX>\lambda_2 = 2</TeX></InlineEquation> the eigenvector is <InlineEquation><TeX>\mathbf{v}_2 = \begin{bmatrix} 1 \\ -1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph>For eigenvalue <InlineEquation><TeX>\lambda_1 =  1</TeX></InlineEquation> the eigenvector is <InlineEquation><TeX>\mathbf{v}_1 = \begin{bmatrix} 2 \\ 3 \end{bmatrix}</TeX></InlineEquation> and for eigenvalue <InlineEquation><TeX>\lambda_2 = 8</TeX></InlineEquation> the eigenvector is <InlineEquation><TeX>\mathbf{v}_2 = \begin{bmatrix} -3 \\ 1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong></SingleChoice></Interaction><Answer><Paragraph> </Paragraph><Paragraph>Following the prescription described in the course: <InlineEquation><TeX>a=7</TeX></InlineEquation>, <InlineEquation><TeX>b=4</TeX></InlineEquation>, <InlineEquation><TeX>c=2</TeX></InlineEquation> and <InlineEquation><TeX>d=5</TeX></InlineEquation>. So we first need to solve the quadratic equation</Paragraph><Equation><TeX> \lambda^2 - (7+5) \lambda + ((7 \times 5) - (4 \times 2)) = 0</TeX></Equation><Paragraph>which is simply</Paragraph><Equation><TeX> \lambda^2 - 12 \lambda + 27 = 0</TeX></Equation><Paragraph>This can be written as</Paragraph><Equation><TeX> (\lambda - 9) (\lambda - 3) = 0</TeX></Equation><Paragraph>So it has solutions <InlineEquation><TeX>\lambda_1 = 9</TeX></InlineEquation> and <InlineEquation><TeX>\lambda_2 = 3</TeX></InlineEquation>. These are the two eigenvalues.</Paragraph><Paragraph>We now write the two eigenvector equations:</Paragraph><Equation><TeX>\begin{split}
    (7 - \lambda) x + 4y &amp; = 0 \\
    2x + (5 - \lambda)y &amp; = 0
\end{split}</TeX></Equation><Paragraph>For eigenvalue <InlineEquation><TeX>\lambda_1 = 9</TeX></InlineEquation> these reduce to
</Paragraph><Equation><TeX>
\begin{split}
    -2x + 4y &amp; = 0 \\
    2x - 4y &amp; = 0
\end{split}</TeX></Equation><Paragraph>Both equations imply that <InlineEquation><TeX>x=2y</TeX></InlineEquation>, so <InlineEquation><TeX>x=2</TeX></InlineEquation> and <InlineEquation><TeX>y=1</TeX></InlineEquation> and the first eigenvector is </Paragraph><Equation><TeX>  \mathbf{v}_1 = \begin{bmatrix} 2 \\ 1 \end{bmatrix}</TeX></Equation><Paragraph>For eigenvalue <InlineEquation><TeX>\lambda_2 = 3</TeX></InlineEquation> these reduce to
</Paragraph><Equation><TeX>
\begin{split}
    4x + 4y &amp; = 0 \\
    2x + 2y &amp; = 0
\end{split}</TeX></Equation><Paragraph>Both equations imply that <InlineEquation><TeX>x=-y</TeX></InlineEquation>, so <InlineEquation><TeX>x=-1</TeX></InlineEquation> and <InlineEquation><TeX>y=1</TeX></InlineEquation> and the second eigenvector is </Paragraph><Equation><TeX>  \mathbf{v}_2 = \begin{bmatrix} -1 \\ 1 \end{bmatrix}</TeX></Equation></Answer></SAQ><SAQ><Heading>Question 3</Heading><Question><Paragraph>If a general spin state is written as <InlineEquation><TeX>|a \rangle = a_1 | \uparrow \rangle + a_2 | \downarrow \rangle</TeX></InlineEquation>, which of the following statements is <i>true</i>?</Paragraph></Question><Interaction><SingleChoice><Wrong><Paragraph>The probability of a measurement indicating spin-up is <InlineEquation><TeX>a_1</TeX></InlineEquation></Paragraph></Wrong><Right><Paragraph>The probability of a measurement indicating spin-down is <InlineEquation><TeX>|a_2|^2</TeX></InlineEquation></Paragraph></Right><Wrong><Paragraph>The probability of a measurement indicating spin-down is <InlineEquation><TeX>|a_1|^2</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph>The probability of a measurement indicating spin-down is <InlineEquation><TeX>a_1 - a_2</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph>The probability of a measurement indicating spin-up is <InlineEquation><TeX>|a_1 + a_2|^2</TeX></InlineEquation></Paragraph></Wrong></SingleChoice></Interaction><Answer><Paragraph>The probability of the outcome of a measurement indicating spin-up is <InlineEquation><TeX>|a_1|^2</TeX></InlineEquation> and for spin-down is <InlineEquation><TeX>|a_2|^2</TeX></InlineEquation>. </Paragraph></Answer></SAQ><SAQ><Heading>Question 4</Heading><Question><Paragraph>Match the following two-particle spin states with the correct descriptions. </Paragraph></Question><Interaction><Matching><Option><Paragraph><InlineEquation><TeX>|1,1 \rangle = | \uparrow \uparrow \rangle</TeX></InlineEquation></Paragraph></Option><Match x_letter="a"><Paragraph>symmetric not entangled state</Paragraph></Match><Option><Paragraph><InlineEquation><TeX>|1,0 \rangle = \frac{1}{\sqrt{2}} \left( | \uparrow \downarrow \rangle + | \downarrow \uparrow \rangle \right)</TeX></InlineEquation></Paragraph></Option><Match x_letter="b"><Paragraph>symmetric entangled state</Paragraph></Match><Option><Paragraph><InlineEquation><TeX>|0,0 \rangle = \frac{1}{\sqrt{2}} \left( | \uparrow \downarrow \rangle - | \downarrow \uparrow \rangle \right)</TeX></InlineEquation></Paragraph></Option><Match x_letter="c"><Paragraph>antisymmetric entangled state</Paragraph></Match></Matching></Interaction><Answer><Paragraph>The triplet states (i.e. <InlineEquation><TeX>|1,1\rangle</TeX></InlineEquation> and <InlineEquation><TeX>|1,0\rangle</TeX></InlineEquation> and <InlineEquation><TeX>|1,-1\rangle</TeX></InlineEquation>) are symmetric and the singlet state (i.e. <InlineEquation><TeX>|0,0\rangle</TeX></InlineEquation>) is antisymmetric under particle exchange. Two-particle states which cannot be factorised (i.e. <InlineEquation><TeX>|0,0\rangle</TeX></InlineEquation> and <InlineEquation><TeX>|1,0\rangle</TeX></InlineEquation>) are known as entangled states. The other states (i.e. <InlineEquation><TeX>|1,1\rangle</TeX></InlineEquation> and <InlineEquation><TeX>|1,-1\rangle</TeX></InlineEquation>) are not entangled.</Paragraph></Answer></SAQ><SAQ><Heading>Question 5</Heading><Question><Paragraph>The quantum NOT gate is represented by which of the following matrices?</Paragraph></Question><Interaction><SingleChoice><Wrong><Paragraph><InlineEquation><TeX>\begin{bmatrix} 1 &amp; 0 \\ 0 &amp; 1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph><InlineEquation><TeX>\begin{bmatrix} 0 &amp; 0 \\ 0 &amp; 0 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong><Right><Paragraph><InlineEquation><TeX>\begin{bmatrix} 0 &amp; 1 \\ 1 &amp; 0 \end{bmatrix}</TeX></InlineEquation></Paragraph></Right><Wrong><Paragraph><InlineEquation><TeX>\begin{bmatrix} 0 &amp; -1 \\ -1 &amp; 0 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph><InlineEquation><TeX>\begin{bmatrix} 1 &amp; 1 \\ 1 &amp; 1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong></SingleChoice></Interaction><Answer><Paragraph>The quantum NOT gate is represented by the Pauli-X operator, <InlineEquation><TeX>\widehat{\mathrm{X}} = \begin{bmatrix} 0 &amp; 1 \\ 1 &amp; 0 \end{bmatrix}</TeX></InlineEquation></Paragraph></Answer></SAQ><SAQ><Heading>Question 6</Heading><Question><Paragraph>The Hadamard gate is represented by which of the following matrices?</Paragraph></Question><Interaction><SingleChoice><Wrong><Paragraph><InlineEquation><TeX>\frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 0 \\ 0 &amp; 1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph><InlineEquation><TeX>\frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; 1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph><InlineEquation><TeX>\frac{1}{\sqrt{2}} \begin{bmatrix} -1 &amp; 0 \\ 0 &amp; -1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong><Right><Paragraph><InlineEquation><TeX>\frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; -1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Right><Wrong><Paragraph><InlineEquation><TeX>\frac{1}{\sqrt{2}} \begin{bmatrix} -1 &amp; 1 \\ 1 &amp; 1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Wrong></SingleChoice></Interaction><Answer><Paragraph>The Hadamard gate is represented by <InlineEquation><TeX>\frac{1}{\sqrt{2}} \begin{bmatrix} 1 &amp; 1 \\ 1 &amp; -1 \end{bmatrix}</TeX></InlineEquation></Paragraph></Answer></SAQ><SAQ><Heading>Question 7</Heading><Question><Paragraph>Match the following quantum gates with the correct result. </Paragraph></Question><Interaction><Matching><Option><Paragraph>NOT gate</Paragraph></Option><Match x_letter="b"><Paragraph>Flips the state of a qubit</Paragraph></Match><Option><Paragraph>CNOT gate</Paragraph></Option><Match x_letter="c"><Paragraph>Entangles a pair of disentangled qubits</Paragraph></Match><Option><Paragraph>Hadamard gate</Paragraph></Option><Match x_letter="a"><Paragraph>Transforms a qubit into a superposition state</Paragraph></Match></Matching></Interaction><Answer><Paragraph>A NOT gate flips the state of a qubit. A CNOT gate can entangle a pair of disentangled qubitts. A Hadamard gate can transform a qubit into a superposition state.</Paragraph></Answer></SAQ><SAQ><Heading>Question 8</Heading><Question><Paragraph>If an input qubit <InlineEquation><TeX>| 0 \rangle</TeX></InlineEquation> is passed to a Hadamard gate, and the output from the Hadamard gate is then passed as input to another Hadamard gate, what will be the output from the second Hadamard gate?</Paragraph></Question><Interaction><SingleChoice><Wrong><Paragraph><InlineEquation><TeX>\frac{1}{\sqrt{2}}(|0 \rangle + |1 \rangle)</TeX></InlineEquation></Paragraph></Wrong><Right><Paragraph><InlineEquation><TeX>|0 \rangle</TeX></InlineEquation></Paragraph></Right><Wrong><Paragraph><InlineEquation><TeX>\frac{1}{\sqrt{2}}(|0 \rangle - |1 \rangle)</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph><InlineEquation><TeX>\frac{1}{2}(|0 \rangle + |1 \rangle)</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph><InlineEquation><TeX>\frac{1}{2}(|0 \rangle - |1 \rangle)</TeX></InlineEquation></Paragraph></Wrong><Wrong><Paragraph><InlineEquation><TeX>|1 \rangle</TeX></InlineEquation></Paragraph></Wrong></SingleChoice></Interaction><Answer><Paragraph>The circuit can be written as <InlineEquation><TeX>\widehat{\mathrm{H}} \widehat{\mathrm{H}} |0 \rangle</TeX></InlineEquation>. The action of the first Hadamard gate produces a superposition state:</Paragraph><Equation><TeX>\widehat{\mathrm{H}}|0 \rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}| 1 \rangle</TeX></Equation><Paragraph>Then passing this through the second Hadamard gate we have</Paragraph><Equation><TeX>\widehat{\mathrm{H}}\widehat{\mathrm{H}}|0 \rangle = \frac{1}{\sqrt{2}}\left( \frac{1}{\sqrt{2}} + \frac{1}{\sqrt{2}} \right) |0\rangle + \frac{1}{\sqrt{2}} \left( \frac{1}{\sqrt{2}} - \frac{1}{\sqrt{2}}\right) | 1 \rangle</TeX></Equation><Equation><TeX>\widehat{\mathrm{H}}\widehat{\mathrm{H}}|0 \rangle = \frac{1}{\sqrt{2}}\left( \frac{1}{\sqrt{2}} + \frac{1}{\sqrt{2}} \right) |0\rangle  = \frac{1}{\sqrt{2}} \left( \frac{2}{\sqrt{2}} \right) | 0 \rangle = | 0 \rangle</TeX></Equation><Paragraph>The action of the second Hadamard gate is therefore to restore the original input qubit.</Paragraph></Answer></SAQ></Session><Session id="nonumber-id38"><Title>Acknowledgements</Title><Paragraph>This free course was written by Christine Leach, Silvia Bergamini, Calum MacCormick and Andrew Norton and first published in June 2025.<!--Author name, to be included if required--></Paragraph><Paragraph>OpenLearn editor: Dale Harry</Paragraph><!--If archive course include following line: 
This free course includes adapted extracts from the course [Module title IN ITALICS]. If you are interested in this subject and want to study formally with us, you may wish to explore other courses we offer in [SUBJET AREA AND EMBEDDED LINK TO STUDY @OU].--><Paragraph>Except for third party materials and otherwise stated (see <a href="http://www.open.ac.uk/conditions">terms and conditions</a>), this content is made available under a <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Licence</a>.</Paragraph><Paragraph>The material acknowledged below is Proprietary and used under licence (not subject to Creative Commons Licence). Grateful acknowledgement is made to the following sources for permission to reproduce material in this free course: </Paragraph><Paragraph><b>Images</b></Paragraph><Paragraph>Course image: bpawesome/istock/Getty Images</Paragraph><Paragraph>Figure 1: Radek Grzybowski/Unsplash</Paragraph><!--The full URLs if required should the hyperlinks above break are as follows: Terms and conditions link  http://www.open.ac.uk/ conditions; Creative Commons link: http://creativecommons.org/ licenses/ by-nc-sa/ 4.0/ deed.en_GB]--><!--<Paragraph>Course image <EditorComment>Acknowledgements provided in production specification or by LTS-Rights</EditorComment></Paragraph>--><!--<Paragraph>
        <EditorComment>Please include  further acknowledgements as provided in production specification or by LTS-Rights in following order:
Text



Images



Figures



Illustrations



Tables



AV



Interactive assets</EditorComment>
      </Paragraph>--><Paragraph>Every effort has been made to contact copyright owners. If any have been inadvertently overlooked, the publishers will be pleased to make the necessary arrangements at the first opportunity.</Paragraph><Paragraph/><Paragraph><b>Don&#x2019;t miss out</b></Paragraph><Paragraph>If reading this text has inspired you to learn more, you may be interested in joining the millions of people who discover our free learning resources and qualifications by visiting The Open University &#x2013; <a href="http://www.open.edu/openlearn/free-courses?LKCAMPAIGN=ebook_&amp;MEDIA=ol">www.open.edu/openlearn/free-courses</a>.</Paragraph></Session></Unit><BackMatter><!--NOW ONLY FOR GLOSSARY: To be completed where appropriate--></BackMatter><settings>
    <numbering>
        
        
        
        <SubSubSection autonumber="false"/>
        <Activity autonumber="false"/>
        <Exercise autonumber="false"/>
        <Box autonumber="false"/>
        <CaseStudy autonumber="false"/>
        <Quote autonumber="false"/>
        <Extract autonumber="false"/>
        <Dialogue autonumber="false"/>
        <ITQ autonumber="false"/>
        <Reading autonumber="false"/>
        <StudyNote autonumber="false"/>
        <Example autonumber="false"/>
        <Verse autonumber="false"/>
        <SAQ autonumber="false"/>
        <KeyPoints autonumber="false"/>
        <ComputerDisplay autonumber="false"/>
        <ProgramListing autonumber="false"/>
        
        <Tables autonumber="false"/>
        <Figures autonumber="false"/>
        <MediaContent autonumber="false"/>
        <Chemistry autonumber="false"/>
    </numbering>
    <discussion_alias>Discussion</discussion_alias>
    <session_prefix/>
<version>2025011400</version><version>2025021001</version></settings><settings>
    <numbering>
        <Session autonumber="false"/>
        <Section autonumber="false"/>
        <SubSection autonumber="false"/>
        <SubSubSection autonumber="false"/>
        <Activity autonumber="false"/>
        <Exercise autonumber="false"/>
        <Box autonumber="false"/>
        <CaseStudy autonumber="false"/>
        <Quote autonumber="false"/>
        <Extract autonumber="false"/>
        <Dialogue autonumber="false"/>
        <ITQ autonumber="false"/>
        <Reading autonumber="false"/>
        <StudyNote autonumber="false"/>
        <Example autonumber="false"/>
        <Verse autonumber="false"/>
        <SAQ autonumber="false"/>
        <KeyPoints autonumber="false"/>
        <ComputerDisplay autonumber="false"/>
        <ProgramListing autonumber="false"/>
        <Summary autonumber="false"/>
        <Tables autonumber="false"/>
        <Figures autonumber="false"/>
        <MediaContent autonumber="false"/>
        <Chemistry autonumber="false"/>
    </numbering>
    <discussion_alias>Discussion</discussion_alias>
    <session_prefix/>
</settings></Item>
