Quantum Computing: Quick Reference Guide

Published 03-21-2019 11:58 AM 515 Views
Microsoft
First published on MSDN on Feb 28, 2018
Already understand the basics and just want to get stuck in? Can't quite remember what the CSWAP matrix looks like? This post is for you.

Here you will find a collection of all the main states/gates/matrices/useful maths bits/etc. covered so far in this blog series. This cheat-sheet will be updated as important new things are introduced in posts :smiling_face_with_smiling_eyes:

For all posts past and future, please refer to the Hitchhiker's Guide to the Quantum Computing and Q# Blog .

Contents



  • The Bloch Sphere

  • Key Quantum States

  • Gates, Matrices and Operations

  • Useful Relationships and Equations


The Bloch Sphere


Any unitary transformation we do on |𝜓〉 can be visualised as simply moving the point (marked |𝜓〉) around the Bloch Sphere*. Sadly, this visualisation can only be used for single qubit states, as there is no known (simple) generalisation that applies to multi-qubit systems. You may also see it referred to in places as the Unit Sphere.

*All pure states can be found on the surface of the sphere, whereas mixed states are located within the sphere. Please refer to my other post Quantum Computing Primer: Pure vs. Mixed States for further explanation.



Key Quantum States


Single-qubit states:





Bell States/EPR pairs - these are the simplest examples of quantum entanglement between two qubits:



GHZ (Greenberger-Horne-Zeilinger) states, shown below both in general form (for n qubits) and in its simplest (three-qubit) form:


Gates, Matrices and Operations


Below is a summary of the key gates as introduced in my previous post about Gates and Circuits . Operations have been included for all single- and two-qubit gates (three plus becomes too big for display). For controlled gates, the identity matrix (𝕀) has been higlighted red and the original gate matrix blue, as seen previously .
Name(s)MatrixCircuit Symbol(s)Q# RepresentationKey Operations
Pauli X , X , NOT, bit flip, X(qubit : Qubit)
Pauli Y , Y, Y(qubit : Qubit)
Pauli Z , Z , phase flip, Z(qubit : Qubit)
Hadamard, H H(qubit : Qubit)
Phase Shift,

R1(theta : Double, qubit : Qubit)


More generally:


R(pauli : Pauli, theta : Double, qubit : Qubit)
Phase, , S S(qubit : Qubit)
, T T(qubit : Qubit)
SWAP
SWAP(qubit1 : Qubit, qubit2 : Qubit)
CNOT CNOT(control : Qubit, target : Qubit)

or

( Controlled X)([control], (target));
CCNOT, Toffoli CCNOT(control1 : Qubit, control2 : Qubit, target : Qubit)

or

( Controlled X)([control1; control2], target);
-
CSWAP, Fredkin ( Controlled SWAP)([control], (target)); -


Useful Relationships and Equations


Pauli Matrices
The Pauli matrices are their own inverse:




Density Operator
The density operator can be defined as follows:



Where:

  • is the probability of the system being in state at the start.

  • The element represents the outer product of the vector with itself, which produces a matrix (this is also known as a projection operator).

  • n is the total number of possible states the system could be in (in our example, 3).

  • as you would expect (the sum of the probabilities for all possible states is equal to 1)


Resources


Learn more at the Microsoft Quantum website: https://www.microsoft.com/en-us/quantum/

Download the Quantum Development Kit: https://www.microsoft.com/en-us/quantum/development-kit

Stay up to date with the Microsoft Quantum newsletter: https://info.microsoft.com/Quantum-Computing-Newsletter-Signup.html

Read about the latest developments on the Microsoft Quantum blog: https://cloudblogs.microsoft.com/quantum/

Twitter: https://twitter.com/MSFTQuantum

Facebook: https://www.facebook.com/MicrosoftQuantum/
%3CLINGO-SUB%20id%3D%22lingo-sub-380659%22%20slang%3D%22en-US%22%3EQuantum%20Computing%3A%20Quick%20Reference%20Guide%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-380659%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20Feb%2028%2C%202018%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20Already%20understand%20the%20basics%20and%20just%20want%20to%20get%20stuck%20in%3F%20Can't%20quite%20remember%20what%20the%20CSWAP%20matrix%20looks%20like%3F%20This%20post%20is%20for%20you.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Here%20you%20will%20find%20a%20collection%20of%20all%20the%20main%20states%2Fgates%2Fmatrices%2Fuseful%20maths%20bits%2Fetc.%20covered%20so%20far%20in%20this%20blog%20series.%20This%20cheat-sheet%20will%20be%20updated%20as%20important%20new%20things%20are%20introduced%20in%20posts%26nbsp%3B%3Asmiling_face_with_smiling_eyes%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20For%20all%20posts%20past%20and%20future%2C%20please%20refer%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fuk_faculty_connection%2F2018%2F02%2F26%2Fthe-hitchhikers-guide-to-the-quantum-computing-and-q-blog%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Hitchhiker's%20Guide%20to%20the%20Quantum%20Computing%20and%20Q%23%20Blog%20%3C%2FA%3E%20.%20%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-1790773432%22%20id%3D%22toc-hId-1680604399%22%3EContents%3C%2FH2%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3EThe%20Bloch%20Sphere%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EKey%20Quantum%20States%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EGates%2C%20Matrices%20and%20Operations%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EUseful%20Relationships%20and%20Equations%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId--761383529%22%20id%3D%22toc-hId--871552562%22%3EThe%20Bloch%20Sphere%3C%2FH2%3E%3CBR%20%2F%3E%20Any%20unitary%20transformation%20we%20do%20on%20%7C%F0%9D%9C%93%E2%8C%AA%20can%20be%20visualised%20as%20simply%20moving%20the%20point%20(marked%20%7C%F0%9D%9C%93%E2%8C%AA)%20around%20the%20Bloch%20Sphere*.%20Sadly%2C%20this%20visualisation%20can%20only%20be%20used%20for%20single%20qubit%20states%2C%20as%20there%20is%20no%20known%20(simple)%20generalisation%20that%20applies%20to%20multi-qubit%20systems.%20You%20may%20also%20see%20it%20referred%20to%20in%20places%20as%20the%20Unit%20Sphere.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20*All%20pure%20states%20can%20be%20found%20on%20the%20surface%20of%20the%20sphere%2C%20whereas%20mixed%20states%20are%20located%20%3CEM%3E%20within%20%3C%2FEM%3E%20the%20sphere.%20Please%20refer%20to%20my%20other%20post%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fuk_faculty_connection%2F2018%2F02%2F27%2Fan-aside-pure-and-mixed-states%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Quantum%20Computing%20Primer%3A%20Pure%20vs.%20Mixed%20States%20%3C%2FA%3E%20for%20further%20explanation.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95977iEF39D010D625C6DF%22%20%2F%3E%20%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-981426806%22%20id%3D%22toc-hId-871257773%22%3E%3C%2FH2%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId--1570730155%22%20id%3D%22toc-hId--1680899188%22%3EKey%20Quantum%20States%3C%2FH2%3E%3CBR%20%2F%3E%20Single-qubit%20states%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95978i6FA258B8809156C4%22%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95979iF0CDCB2A187FC348%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2F2018%2F02%2FBlochSphere21.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20%3C%2FA%3E%20Bell%20States%2FEPR%20pairs%20-%20these%20are%20the%20simplest%20examples%20of%20quantum%20entanglement%20between%20two%20qubits%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95980iA0465A8EED9B4E1A%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20GHZ%20(Greenberger-Horne-Zeilinger)%20states%2C%20shown%20below%20both%20in%20general%20form%20(for%20%3CI%3E%20n%20%3C%2FI%3E%20qubits)%20and%20in%20its%20simplest%20(three-qubit)%20form%3A%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95981iF94AAE77F0737F70%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-172080180%22%20id%3D%22toc-hId-61911147%22%3EGates%2C%20Matrices%20and%20Operations%3C%2FH2%3E%3CBR%20%2F%3E%20Below%20is%20a%20summary%20of%20the%20key%20gates%20as%20introduced%20in%20my%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fuk_faculty_connection%2F2018%2F02%2F26%2Fquantum-gates-and-circuits-the-crash-course%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20previous%20post%20about%20Gates%20and%20Circuits%20%3C%2FA%3E%20.%20Operations%20have%20been%20included%20for%20all%20single-%20and%20two-qubit%20gates%20(three%20plus%20becomes%20too%20big%20for%20display).%20For%20controlled%20gates%2C%20the%20identity%20matrix%20(%F0%9D%95%80)%20has%20been%20higlighted%20red%20and%20the%20original%20gate%20matrix%20blue%2C%20as%20seen%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fuk_faculty_connection%2F2018%2F02%2F26%2Fquantum-gates-and-circuits-the-crash-course%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20previously%3C%2FA%3E%20.%20%3CBR%20%2F%3E%3CTABLE%3E%0A%20%20%20%3CTBODY%3E%3CTR%3EName(s)MatrixCircuit%20Symbol(s)Q%23%20RepresentationKey%20Operations%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3EPauli%20%3CEM%3E%20X%20%3C%2FEM%3E%20%2C%20%3CEM%3E%20X%20%3C%2FEM%3E%20%2C%20NOT%2C%20bit%20flip%2C%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95982i593650999B1284DE%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95983iFD6EA0CABD4EB2D8%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95984i01493C7ABD647021%22%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95985iE6C96051CDEE3487%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.x%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20X(qubit%20%3A%20Qubit)%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95986i683E040D17666026%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3EPauli%20%3CEM%3E%20Y%20%3C%2FEM%3E%20%2C%20%3CEM%3E%20Y%2C%3C%2FEM%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95987i1918CADCCA8344FD%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95988iC03451E4069B0333%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95990i6EAD9EA42792BFE8%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.y%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Y(qubit%20%3A%20Qubit)%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95991i0200D98E63827EFA%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3EPauli%20%3CEM%3E%20Z%20%3C%2FEM%3E%20%2C%20%3CEM%3E%20Z%20%3C%2FEM%3E%20%2C%20phase%20flip%2C%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95992iF8E2D303A5045B0C%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95993i472BCD9DCCDE5A39%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95994iA36F2D51D6B54875%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.z%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Z(qubit%20%3A%20Qubit)%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95995iC6BCE31EA860D62E%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3EHadamard%2C%20%3CEM%3E%20H%3C%2FEM%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2F2018%2F02%2Fimage_2018-02-13_11-36-12.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20%3C%2FA%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95996iF237A256A10C38AF%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95997i74A556FDF2799859%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.h%3Fview%3Dqsharp-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20H(qubit%20%3A%20Qubit)%20%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.x%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95998iF43796678F861ABA%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3EPhase%20Shift%2C%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F95999iF6F6F2E2CC810F98%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2F2018%2F02%2Fimage_2018-02-13_11-36-44.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20%3C%2FA%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96000iE118E5D9AD76F1FF%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96001i2647DD7BAAB7B875%22%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2F2018%2F02%2FPauliY.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.r1%3Fview%3Dqsharp-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20R1(theta%20%3A%20Double%2C%20qubit%20%3A%20Qubit)%20%3C%2FA%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMore%20generally%3A%3C%2FP%3E%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.r%3Fview%3Dqsharp-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20R(pauli%20%3A%20Pauli%2C%20theta%20%3A%20Double%2C%20qubit%20%3A%20Qubit)%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96002i13C66755467F0CFD%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3EPhase%2C%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96003i67F42CF4887AC2C3%22%20%2F%3E%20%2C%20%3CEM%3E%20S%3C%2FEM%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2F2018%2F02%2Fimage_2018-02-13_11-39-37.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20%3C%2FA%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96004iD3C5C60C9055410C%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96005iEAAF2ADCBA1D5E1F%22%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2F2018%2F02%2FPauliZ.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.z%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.s%3Fview%3Dqsharp-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20S(qubit%20%3A%20Qubit)%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96006iAC8D91A78E98ECD3%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3E%3CEM%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96007i2971CD841787C80F%22%20%2F%3E%20%2C%20T%20%3C%2FEM%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96008i50C35C6AAC1180F3%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96009iA62AC1F2357D741B%22%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2F2018%2F02%2FPauliZ.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.t%3Fview%3Dqsharp-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20T(qubit%20%3A%20Qubit)%20%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.z%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2F2018%2F02%2Fimage_2018-02-13_11-36-12.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20%3C%2FA%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96010i471FCC3C6BF9E522%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3ESWAP%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96011iEE18246FB0C96221%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96012i0D868A8255881E05%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.x%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.swap%3Fview%3Dqsharp-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20SWAP(qubit1%20%3A%20Qubit%2C%20qubit2%20%3A%20Qubit)%20%3C%2FA%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96013i7853EC0AC7F1F2DB%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3ECNOT%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96014i0B02E680268D9686%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96015iC378A8E4955A44FA%22%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.cnot%3Fview%3Dqsharp-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECNOT(control%20%3A%20Qubit%2C%20target%20%3A%20Qubit)%20%3C%2FA%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20or%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CCODE%3E%0A%20%20%20%20%20%20(%0A%20%20%20%20%20%20%3CSTRONG%3E%0A%20%20%20%20%20%20%20Controlled%0A%20%20%20%20%20%20%3C%2FSTRONG%3E%0A%20%20%20%20%20%20X)(%5Bcontrol%5D%2C%20(target))%3B%0A%20%20%20%20%20%3C%2FCODE%3E%0A%20%20%20%20%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.x%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%0A%20%20%20%20%20%3C%2FA%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96016iA285DF74276DB451%22%20%2F%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20CCNOT%2C%20Toffoli%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96017i26A1C32E75810DF8%22%20%2F%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96018i8C4EA3FD7C9C86CB%22%20%2F%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fqsharp%2Fapi%2Fprelude%2Fmicrosoft.quantum.primitive.ccnot%3Fview%3Dqsharp-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%0A%20%20%20%20%20%20CCNOT(control1%20%3A%20Qubit%2C%20control2%20%3A%20Qubit%2C%20target%20%3A%20Qubit)%0A%20%20%20%20%20%3C%2FA%3E%0A%20%20%20%20%20%3CBR%20%2F%3E%0A%20%20%20%20%20%3CBR%20%2F%3E%0A%20%20%20%20%20or%0A%20%20%20%20%20%3CBR%20%2F%3E%0A%20%20%20%20%20%3CBR%20%2F%3E%0A%20%20%20%20%20%3CCODE%3E%0A%20%20%20%20%20%20(%0A%20%20%20%20%20%20%3CSTRONG%3E%0A%20%20%20%20%20%20%20Controlled%0A%20%20%20%20%20%20%3C%2FSTRONG%3E%0A%20%20%20%20%20%20X)(%5Bcontrol1%3B%20control2%5D%2C%20target)%3B%0A%20%20%20%20%20%3C%2FCODE%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20-%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%20%3CTR%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20CSWAP%2C%20Fredkin%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96019i4444AFF6797B35CA%22%20%2F%3E%0A%20%20%20%20%20%3CA%20href%3D%22https%3A%2F%2Fmsdnshared.blob.core.windows.net%2Fmedia%2F2018%2F02%2Fimage_2018-02-13_11-39-37.png%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%0A%20%20%20%20%20%3C%2FA%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96020iE50B5423DF6576E1%22%20%2F%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20%3CCODE%3E%0A%20%20%20%20%20%20(%0A%20%20%20%20%20%20%3CSTRONG%3E%0A%20%20%20%20%20%20%20Controlled%0A%20%20%20%20%20%20%3C%2FSTRONG%3E%0A%20%20%20%20%20%20SWAP)(%5Bcontrol%5D%2C%20(target))%3B%0A%20%20%20%20%20%3C%2FCODE%3E%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%20%3CTD%3E%0A%20%20%20%20%20-%0A%20%20%20%20%3C%2FTD%3E%0A%20%20%20%3C%2FTR%3E%0A%20%20%3C%2FTBODY%3E%3C%2FTABLE%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CH2%20id%3D%22toc-hId-1914890515%22%20id%3D%22toc-hId-1804721482%22%3E%0A%20%20%3C%2FH2%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CH2%20id%3D%22toc-hId--637266446%22%20id%3D%22toc-hId--747435479%22%3E%0A%20%20%20Useful%20Relationships%20and%20Equations%0A%20%20%3C%2FH2%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Pauli%20Matrices%0A%20%20%3CBR%20%2F%3E%0A%20%20The%20Pauli%20matrices%20are%20their%20own%20inverse%3A%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96021i170FBBF578680767%22%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Density%20Operator%0A%20%20%3CBR%20%2F%3E%0A%20%20The%20density%20operator%20can%20be%20defined%20as%20follows%3A%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96022i1DEDA04FAF6256A1%22%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Where%3A%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CUL%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%3CLI%3E%0A%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96023iFDA9B8282B6EDA62%22%20%2F%3E%0A%20%20%20%20is%20the%20probability%20of%20the%20system%20being%20in%20state%0A%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96024i616446C745573398%22%20%2F%3E%0A%20%20%20%20at%20the%20start.%0A%20%20%20%3C%2FLI%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%3CLI%3E%0A%20%20%20%20The%0A%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96025i0C960339CE133EA8%22%20%2F%3E%0A%20%20%20%20element%20represents%20the%20outer%20product%20of%20the%20vector%0A%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96026i8DE593A0D5D7AD59%22%20%2F%3E%0A%20%20%20%20with%20itself%2C%20which%20produces%20a%20matrix%20(this%20is%20also%20known%20as%20a%20projection%20operator).%0A%20%20%20%3C%2FLI%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%3CLI%3E%0A%20%20%20%20%3CEM%3E%0A%20%20%20%20%20n%0A%20%20%20%20%3C%2FEM%3E%0A%20%20%20%20is%20the%20total%20number%20of%20possible%20states%20the%20system%20could%20be%20in%20(in%20our%20example%2C%203).%0A%20%20%20%3C%2FLI%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%20%3CLI%3E%0A%20%20%20%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F96027iDAD4C3945143AF49%22%20%2F%3E%0A%20%20%20%20as%20you%20would%20expect%20(the%20sum%20of%20the%20probabilities%20for%20all%20possible%20states%20is%20equal%20to%201)%0A%20%20%20%3C%2FLI%3E%0A%20%20%20%3CBR%20%2F%3E%0A%20%20%3C%2FUL%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CH2%20id%3D%22toc-hId-1105543889%22%20id%3D%22toc-hId-995374856%22%3E%0A%20%20%20Resources%0A%20%20%3C%2FH2%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Learn%20more%20at%20the%20Microsoft%20Quantum%20website%3A%0A%20%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fquantum%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%0A%20%20%20https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fquantum%2F%0A%20%20%3C%2FA%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Download%20the%20Quantum%20Development%20Kit%3A%0A%20%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fquantum%2Fdevelopment-kit%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%0A%20%20%3C%2FA%3E%0A%20%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fquantum%2Fdevelopment-kit%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%0A%20%20%20https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fquantum%2Fdevelopment-kit%0A%20%20%3C%2FA%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Stay%20up%20to%20date%20with%20the%20Microsoft%20Quantum%20newsletter%3A%0A%20%20%3CA%20href%3D%22https%3A%2F%2Finfo.microsoft.com%2FQuantum-Computing-Newsletter-Signup.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%0A%20%20%3C%2FA%3E%0A%20%20%3CA%20href%3D%22https%3A%2F%2Finfo.microsoft.com%2FQuantum-Computing-Newsletter-Signup.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%0A%20%20%20https%3A%2F%2Finfo.microsoft.com%2FQuantum-Computing-Newsletter-Signup.html%0A%20%20%3C%2FA%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Read%20about%20the%20latest%20developments%20on%20the%20Microsoft%20Quantum%20blog%3A%0A%20%20%3CA%20href%3D%22https%3A%2F%2Fcloudblogs.microsoft.com%2Fquantum%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%0A%20%20%3C%2FA%3E%0A%20%20%3CA%20href%3D%22https%3A%2F%2Fcloudblogs.microsoft.com%2Fquantum%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%0A%20%20%20https%3A%2F%2Fcloudblogs.microsoft.com%2Fquantum%2F%0A%20%20%3C%2FA%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Twitter%3A%0A%20%20%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2FMSFTQuantum%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%0A%20%20%20https%3A%2F%2Ftwitter.com%2FMSFTQuantum%0A%20%20%3C%2FA%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20%3CBR%20%2F%3E%0A%20%20Facebook%3A%0A%20%20%3CA%20href%3D%22https%3A%2F%2Fwww.facebook.com%2FMicrosoftQuantum%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%0A%20%20%20https%3A%2F%2Fwww.facebook.com%2FMicrosoftQuantum%2F%0A%20%20%3C%2FA%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-380659%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Feb%2028%2C%202018%20Already%20understand%20the%20basics%20and%20just%20want%20to%20get%20stuck%20in%3F%20Can't%20quite%20remember%20what%20the%20CSWAP%20matrix%20looks%20like%3F%20This%20post%20is%20for%20you.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-380659%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eacademic%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ecomputing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Efaculty%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Elearning%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Equantum%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuantum%20Computing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Estudent%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Estudents%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Mar 21 2019 11:59 AM
Updated by: