(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.1' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 20359, 703]*) (*NotebookOutlinePosition[ 20997, 725]*) (* CellTagsIndexPosition[ 20953, 721]*) (*WindowFrame->Normal*) Notebook[{ Cell[BoxData[ \(Construction\ of\ \ Toffoli\ gate\)], "Input", Evaluatable->False], Cell[BoxData[ \(\(\(Needs["\"]\)\(\ \[IndentingNewLine]\) \)\)], "Input"], Cell[BoxData[ \(\(\(The\)\(\ \)\(Toffoli\)\(\ \)\(gate\)\(\ \)\)\)], "Input", Evaluatable->False], Cell[BoxData[ ButtonBox["Fig1", ButtonData:>{ URL[ "http://www.physics.unlv.edu/~bernard/phy771/fig1.pdf"], None}, ButtonStyle->"Hyperlink"]], "Input"], Cell[BoxData[{ \(The\ Toffoli\ gate\ is\ a\ three - qubit\ gate, \ we\ first\), "\[IndentingNewLine]", \(need\ to\ construct\ the\ computational\ basis\ kets\ for\), "\ \[IndentingNewLine]", \(this\ space . \*"\"\<\>"\)}], "Input", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(\("\";\)\[IndentingNewLine]\), "\ \[IndentingNewLine]", \(one = {0, 1}; zero = {1, 0};\), "\[IndentingNewLine]", \(twoqubit = Flatten[Outer[Times, zero, zero]]\), "\[IndentingNewLine]", \(\("\< then take direct product with third qubit\>";\)\), "\[IndentingNewLine]", \(Outer[Times, zero, twoqubit]\), "\[IndentingNewLine]", \(Flatten[%]\)}], "Input"], Cell[BoxData[ \({1, 0, 0, 0}\)], "Output"], Cell[BoxData[ \({{1, 0, 0, 0}, {0, 0, 0, 0}}\)], "Output"], Cell[BoxData[ \({1, 0, 0, 0, 0, 0, 0, 0}\)], "Output"] }, Open ]], Cell[BoxData[ \(\("\";\)\)], "Input"], Cell[BoxData[ \(threequbit[ket1_, ket2_, ket3_] := Module[{twoqubit}, twoqubit = Flatten[Outer[Times, ket2, ket3]]; Flatten[Outer[Times, ket1, twoqubit]]]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\("\<|000>\>"\[IndentingNewLine] ket0 = threequbit[zero, zero, zero]\)\)\)], "Input"], Cell[BoxData[ \("|000>"\)], "Output"], Cell[BoxData[ \({1, 0, 0, 0, 0, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(\ \)\("\<|001>\>"\[IndentingNewLine] ket1 = threequbit[zero, zero, one]\)\)\)], "Input"], Cell[BoxData[ \("|001>"\)], "Output"], Cell[BoxData[ \({0, 1, 0, 0, 0, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \("\<|010>\>"\), "\[IndentingNewLine]", \(ket2 = threequbit[zero, one, zero]\)}], "Input"], Cell[BoxData[ \("|010>"\)], "Output"], Cell[BoxData[ \({0, 0, 1, 0, 0, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \("\<|011>\>"\), "\[IndentingNewLine]", \(ket3 = threequbit[zero, one, one]\)}], "Input"], Cell[BoxData[ \("|011>"\)], "Output"], Cell[BoxData[ \({0, 0, 0, 1, 0, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \("\<|100>\>"\), "\[IndentingNewLine]", \(ket4 = threequbit[one, zero, zero]\)}], "Input"], Cell[BoxData[ \("|100>"\)], "Output"], Cell[BoxData[ \({0, 0, 0, 0, 1, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \("\<|101>\>"\), "\[IndentingNewLine]", \(ket5 = threequbit[one, zero, one]\)}], "Input"], Cell[BoxData[ \("|101>"\)], "Output"], Cell[BoxData[ \({0, 0, 0, 0, 0, 1, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \("\<|110>\>"\), "\[IndentingNewLine]", \(ket6 = threequbit[one, one, zero]\)}], "Input"], Cell[BoxData[ \("|110>"\)], "Output"], Cell[BoxData[ \({0, 0, 0, 0, 0, 0, 1, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \("\<|111>\>"\), "\[IndentingNewLine]", \(ket7 = threequbit[one, one, one]\)}], "Input"], Cell[BoxData[ \("|111>"\)], "Output"], Cell[BoxData[ \({0, 0, 0, 0, 0, 0, 0, 1}\)], "Output"] }, Open ]], Cell[BoxData[{ \(Having\ constructed\ the\ basis\ states\ we\ can\ \), "\ \[IndentingNewLine]", \(now\ construct\ the\ toffoli\ \(\(gate\)\(.\)\)\)}], "Input", Evaluatable->False], Cell[BoxData[{ \(In\ this\ gate, \ the\ third\ qubit\ is\ the\ target\ bit\), "\[IndentingNewLine]", \(whereas\ the\ first\ two\ qubits\ are\ control\ qubits . \ \[IndentingNewLine]According\ to\ our\ \(\(definition\)\(:\)\)\)}], "Input", Evaluatable->False], Cell[BoxData[ \(\("\<00| \[CircleTimes] I +|01><01|\[CircleTimes] I +\ \[IndentingNewLine]|10><10|\[CircleTimes] I \ +|11><11|\[CircleTimes]PauliX\>";\)\)], "Input", Evaluatable->False], Cell[BoxData[ \(Here\ I\ is\ the\ identity\ matrix\ for\ the\ target\ qubit\ and\ \ PauliX\ is\ the\ Pauli\ gate\ for\ the\ target\ \(\(qubit\)\(.\)\)\)], "Input",\ Evaluatable->False], Cell[BoxData[{ \(\(\("\";\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(\(|\)\(00 > < 00\)\(|\)\(\ \)\(\[CircleTimes]\ I\)\)\)}], "Input", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[{ \(\("\";\)\[IndentingNewLine]\), "\ \[IndentingNewLine]", \(zerozero = Flatten[Outer[Times, zero, zero]]\), "\[IndentingNewLine]", \(zeroone = Flatten[Outer[Times, zero, one]]\), "\[IndentingNewLine]", \(onezero = Flatten[Outer[Times, one, zero]]\), "\[IndentingNewLine]", \(oneone = Flatten[Outer[Times, one, one]]\)}], "Input"], Cell[BoxData[ \({1, 0, 0, 0}\)], "Output"], Cell[BoxData[ \({0, 1, 0, 0}\)], "Output"], Cell[BoxData[ \({0, 0, 1, 0}\)], "Output"], Cell[BoxData[ \({0, 0, 0, 1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(operator00 = Outer[Times, zerozero, zerozero]\)], "Input"], Cell[BoxData[ \({{1, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}\)], "Output"] }, Open ]], Cell[BoxData[ \(unit = {{1, 0}, {0, 1}}; PauliX = {{0, 1}, {1, 0}}; PauliY = {{0, \(-I\)}, {I, 0}}; PauliZ = {{1, 0}, {0, \(-1\)}};\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(Outer[Times, operator00, unit]\), "\[IndentingNewLine]", \(BlockMatrix[%]\), "\[IndentingNewLine]", \(MatrixForm[%]\)}], "Input"], Cell[BoxData[ \({{{{1, 0}, {0, 1}}, {{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}}, {{{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}}, {{{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}}, {{{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}, {{0, 0}, {0, 0}}}}\)], "Output"], Cell[BoxData[ \({{1, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}\)], "Output"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0", "0", "0", "0", "0", "0"}, {"0", "1", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"} }, RowSpacings->1, ColumnSpacings->1, ColumnAlignments->{Left}], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[BoxData[{ \(\(Thus;\)\[IndentingNewLine]\), "\[IndentingNewLine]", \(threequbitoperator[controlq1_, controlq2_, targetoperator_] := Module[{}, controlqubits = Flatten[Outer[Times, controlq1, controlq2]]; twoqubitoperator = Outer[Times, controlqubits, controlqubits]; \[IndentingNewLine]BlockMatrix[ Outer[Times, twoqubitoperator, targetoperator]]]\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(threequbitoperator[zero, zero, unit];\)\), "\[IndentingNewLine]", \(MatrixForm[%]\)}], "Input"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0", "0", "0", "0", "0", "0"}, {"0", "1", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0"} }, RowSpacings->1, ColumnSpacings->1, ColumnAlignments->{Left}], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[BoxData[ \(\("\";\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(toffoli = threequbitoperator[zero, zero, unit] + threequbitoperator[zero, one, unit] + threequbitoperator[one, zero, unit] + threequbitoperator[one, one, PauliX]\)], "Input"], Cell[BoxData[ \({{1, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 1, 0}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(MatrixForm[toffoli]\)], "Input"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0", "0", "0", "0", "0", "0"}, {"0", "1", "0", "0", "0", "0", "0", "0"}, {"0", "0", "1", "0", "0", "0", "0", "0"}, {"0", "0", "0", "1", "0", "0", "0", "0"}, {"0", "0", "0", "0", "1", "0", "0", "0"}, {"0", "0", "0", "0", "0", "1", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "1"}, {"0", "0", "0", "0", "0", "0", "1", "0"} }, RowSpacings->1, ColumnSpacings->1, ColumnAlignments->{Left}], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[BoxData[ \(\("\";\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(ket0\), "\[IndentingNewLine]", \(toffoli . ket0\)}], "Input"], Cell[BoxData[ \({1, 0, 0, 0, 0, 0, 0, 0}\)], "Output"], Cell[BoxData[ \({1, 0, 0, 0, 0, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(ket1\), "\[IndentingNewLine]", \(toffoli . ket1\)}], "Input"], Cell[BoxData[ \({0, 1, 0, 0, 0, 0, 0, 0}\)], "Output"], Cell[BoxData[ \({0, 1, 0, 0, 0, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(ket2\), "\[IndentingNewLine]", \(toffoli . ket2\)}], "Input"], Cell[BoxData[ \({0, 0, 1, 0, 0, 0, 0, 0}\)], "Output"], Cell[BoxData[ \({0, 0, 1, 0, 0, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(ket3\), "\[IndentingNewLine]", \(toffoli . ket3\)}], "Input"], Cell[BoxData[ \({0, 0, 0, 1, 0, 0, 0, 0}\)], "Output"], Cell[BoxData[ \({0, 0, 0, 1, 0, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(ket4\), "\[IndentingNewLine]", \(toffoli . ket4\)}], "Input"], Cell[BoxData[ \({0, 0, 0, 0, 1, 0, 0, 0}\)], "Output"], Cell[BoxData[ \({0, 0, 0, 0, 1, 0, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(ket5\), "\[IndentingNewLine]", \(toffoli . ket5\)}], "Input"], Cell[BoxData[ \({0, 0, 0, 0, 0, 1, 0, 0}\)], "Output"], Cell[BoxData[ \({0, 0, 0, 0, 0, 1, 0, 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(ket6\), "\[IndentingNewLine]", \(toffoli . ket6\)}], "Input"], Cell[BoxData[ \({0, 0, 0, 0, 0, 0, 1, 0}\)], "Output"], Cell[BoxData[ \({0, 0, 0, 0, 0, 0, 0, 1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(ket7\), "\[IndentingNewLine]", \(toffoli . ket7\)}], "Input"], Cell[BoxData[ \({0, 0, 0, 0, 0, 0, 0, 1}\)], "Output"], Cell[BoxData[ \({0, 0, 0, 0, 0, 0, 1, 0}\)], "Output"] }, Open ]], Cell[BoxData[{ \(\(\(TOFFOLI\ GATE\ TRUTH\ TABLE\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(0\ 0\ 0 | \ 0\ 0\ 0\), "\[IndentingNewLine]", \(0\ 0\ 1 | \ 0\ 0\ \ 1\), "\[IndentingNewLine]", \(0\ 1\ 0 | \ 0\ 1\ 0\), "\[IndentingNewLine]", \(0\ 1\ 1 | \ 0\ 1\ \ 1\), "\[IndentingNewLine]", \(1\ 0\ 0 | \ 1\ 0\ 0\), "\[IndentingNewLine]", \(1\ 0\ 1 | \ 1\ 0\ \ 1\), "\[IndentingNewLine]", \(1\ 1\ 0 | \ 1\ 1\ \ 1\), "\[IndentingNewLine]", \(1\ 1\ 1 | \ 1\ 1\ \ 0\), "\[IndentingNewLine]", \(\)}], "Input", Evaluatable->False], Cell[BoxData[ \(Another\ important\ gate\ is\ the\ controlled\ swap\ or\ Fredkin\ \ gate\)], "Input", Evaluatable->False], Cell[BoxData[{ RowBox[{\("\";\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ ButtonBox["Fig2", ButtonData:>{ URL[ "http://www.physics.unlv.edu/~bernard/phy771/fig2.pdf"], None}, ButtonStyle->"Hyperlink"], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \("\";\ \)}], "Input"], Cell[BoxData[ \(swap = \(\(|\)\(00 > < 00\)\(|\)\(+\(\(|\)\(01 > < 10\)\(|\)\(+\(\(|\)\(10 > < 01\)\(|\)\(+\(\(|\)\(11 > < 11\)\(|\)\)\)\)\)\)\)\)\)], "Input", Evaluatable->False], Cell[BoxData[ \(or\)], "Input", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(swap = Outer[Times, zerozero, zerozero] + Outer[Times, onezero, zeroone] + \[IndentingNewLine]\ \ Outer[Times, zeroone, onezero] + \ Outer[Times, oneone, oneone]\)], "Input"], Cell[BoxData[ \({{1, 0, 0, 0}, {0, 0, 1, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(MatrixForm[swap]\)], "Input"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0", "0"}, {"0", "0", "1", "0"}, {"0", "1", "0", "0"}, {"0", "0", "0", "1"} }, RowSpacings->1, ColumnSpacings->1, ColumnAlignments->{Left}], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\("\";\)\[IndentingNewLine]\), "\ \[IndentingNewLine]", \(swap . zerozero \[Equal] zerozero\), "\[IndentingNewLine]", \(swap . zeroone \[Equal] onezero\), "\[IndentingNewLine]", \(swap . onezero \[Equal] zeroone\), "\[IndentingNewLine]", \(swap . oneone \[Equal] oneone\)}], "Input"], Cell[BoxData[ \(True\)], "Output"], Cell[BoxData[ \(True\)], "Output"], Cell[BoxData[ \(True\)], "Output"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[{ \(\(\(2 - qubit\ swap\ \ GATE\ TRUTH\ TABLE\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(0\ 0\ | \ \(\(0\)\(\ \)\(0\)\(\ \)\)\), "\[IndentingNewLine]", \(0\ 1 | \ \ 1\ 0\), "\[IndentingNewLine]", \(1\ 0 | \ \(\(0\)\(\ \)\(1\)\(\ \)\)\), "\[IndentingNewLine]", \(1\ 1 | \ 1\ \ 1\)}], "Input", Evaluatable->False], Cell[BoxData[ \(We\ now\ construct\ the\ 3 - qubit\ controlled\ swap\)], "Input", Evaluatable->False], Cell[BoxData[{ RowBox[{\(\*"\"\\"";\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", ButtonBox["Fig3", ButtonData:>{ URL[ "http://www.physics.unlv.edu/~bernard/phy771/fig3.pdf"], None}, ButtonStyle->"Hyperlink"]}], "Input"], Cell[BoxData[ \(fredkin = \(\(|\)\(0 > < 0\)\(|\)\(\(\[CircleTimes]I\)\(+\)\)\(|\)\(1 > < 1\)\(|\)\(\[CircleTimes]\ swap\)\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(term1 = Outer[Times, zero, zero];\)\), "\[IndentingNewLine]", \(term2 = BlockMatrix[Outer[Times, unit, unit]]; operator1 = BlockMatrix[Outer[Times, term1, term2]]\)}], "Input"], Cell[BoxData[ \({{1, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}\)], "Output"] }, Open ]], Cell[BoxData[{ \(\(term1 = Outer[Times, zero, zero];\)\), "\[IndentingNewLine]", \(term2 = BlockMatrix[Outer[Times, unit, unit]]; operator1 = BlockMatrix[Outer[Times, term1, term2]]\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(term1 = Outer[Times, one, one];\)\), "\[IndentingNewLine]", \(\(term2 = swap;\)\), "\[IndentingNewLine]", \(operator2 = BlockMatrix[Outer[Times, term1, term2]]\)}], "Input"], Cell[BoxData[ \({{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(fredkin = operator1 + operator2\)], "Input"], Cell[BoxData[ \({{1, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(MatrixForm[fredkin]\)], "Input"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0", "0", "0", "0", "0", "0"}, {"0", "1", "0", "0", "0", "0", "0", "0"}, {"0", "0", "1", "0", "0", "0", "0", "0"}, {"0", "0", "0", "1", "0", "0", "0", "0"}, {"0", "0", "0", "0", "1", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "1", "0"}, {"0", "0", "0", "0", "0", "1", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "1"} }, RowSpacings->1, ColumnSpacings->1, ColumnAlignments->{Left}], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[BoxData[ \(The\ fredkin\ gate\ only\ swaps\ bits\ when\ the\ control\ qubit\ is\ \ turned\ \(\(on\)\(.\)\)\)], "Input", Evaluatable->False] }, FrontEndVersion->"5.1 for Macintosh", ScreenRectangle->{{0, 1024}, {0, 719}}, WindowSize->{639, 597}, WindowMargins->{{150, Automatic}, {Automatic, 20}} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 88, 2, 27, "Input", Evaluatable->False], Cell[1845, 55, 117, 3, 43, "Input"], Cell[1965, 60, 103, 2, 27, "Input", Evaluatable->False], Cell[2071, 64, 175, 4, 27, "Input"], Cell[2249, 70, 272, 6, 59, "Input", Evaluatable->False], Cell[CellGroupData[{ Cell[2546, 80, 422, 8, 139, "Input"], Cell[2971, 90, 46, 1, 27, "Output"], Cell[3020, 93, 62, 1, 27, "Output"], Cell[3085, 96, 58, 1, 27, "Output"] }, Open ]], Cell[3158, 100, 67, 1, 27, "Input"], Cell[3228, 103, 187, 3, 59, "Input"], Cell[CellGroupData[{ Cell[3440, 110, 134, 2, 59, "Input"], Cell[3577, 114, 41, 1, 27, "Output"], Cell[3621, 117, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3716, 123, 116, 2, 43, "Input"], Cell[3835, 127, 41, 1, 27, "Output"], Cell[3879, 130, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3974, 136, 114, 2, 43, "Input"], Cell[4091, 140, 41, 1, 27, "Output"], Cell[4135, 143, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4230, 149, 113, 2, 43, "Input"], Cell[4346, 153, 41, 1, 27, "Output"], Cell[4390, 156, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4485, 162, 114, 2, 43, "Input"], Cell[4602, 166, 41, 1, 27, "Output"], Cell[4646, 169, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4741, 175, 113, 2, 43, "Input"], Cell[4857, 179, 41, 1, 27, "Output"], Cell[4901, 182, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4996, 188, 113, 2, 43, "Input"], Cell[5112, 192, 41, 1, 27, "Output"], Cell[5156, 195, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5251, 201, 112, 2, 43, "Input"], Cell[5366, 205, 41, 1, 27, "Output"], Cell[5410, 208, 58, 1, 27, "Output"] }, Open ]], Cell[5483, 212, 190, 4, 43, "Input", Evaluatable->False], Cell[5676, 218, 274, 5, 59, "Input", Evaluatable->False], Cell[5953, 225, 205, 4, 43, "Input", Evaluatable->False], Cell[6161, 231, 191, 4, 43, "Input", Evaluatable->False], Cell[6355, 237, 252, 5, 76, "Input", Evaluatable->False], Cell[CellGroupData[{ Cell[6632, 246, 393, 6, 107, "Input"], Cell[7028, 254, 46, 1, 27, "Output"], Cell[7077, 257, 46, 1, 27, "Output"], Cell[7126, 260, 46, 1, 27, "Output"], Cell[7175, 263, 46, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7258, 269, 78, 1, 27, "Input"], Cell[7339, 272, 90, 1, 27, "Output"] }, Open ]], Cell[7444, 276, 158, 3, 59, "Input"], Cell[CellGroupData[{ Cell[7627, 283, 160, 3, 59, "Input"], Cell[7790, 288, 382, 5, 75, "Output"], Cell[8175, 295, 269, 4, 59, "Output"], Cell[8447, 301, 702, 16, 137, "Output"] }, Open ]], Cell[9164, 320, 425, 7, 123, "Input"], Cell[CellGroupData[{ Cell[9614, 331, 123, 2, 43, "Input"], Cell[9740, 335, 702, 16, 137, "Output"] }, Open ]], Cell[10457, 354, 53, 1, 27, "Input"], Cell[CellGroupData[{ Cell[10535, 359, 228, 5, 75, "Input"], Cell[10766, 366, 269, 4, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[11072, 375, 52, 1, 27, "Input"], Cell[11127, 378, 702, 16, 137, "Output"] }, Open ]], Cell[11844, 397, 93, 1, 27, "Input"], Cell[CellGroupData[{ Cell[11962, 402, 87, 2, 43, "Input"], Cell[12052, 406, 58, 1, 27, "Output"], Cell[12113, 409, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12208, 415, 87, 2, 43, "Input"], Cell[12298, 419, 58, 1, 27, "Output"], Cell[12359, 422, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12454, 428, 87, 2, 43, "Input"], Cell[12544, 432, 58, 1, 27, "Output"], Cell[12605, 435, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12700, 441, 87, 2, 43, "Input"], Cell[12790, 445, 58, 1, 27, "Output"], Cell[12851, 448, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12946, 454, 87, 2, 43, "Input"], Cell[13036, 458, 58, 1, 27, "Output"], Cell[13097, 461, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[13192, 467, 87, 2, 43, "Input"], Cell[13282, 471, 58, 1, 27, "Output"], Cell[13343, 474, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[13438, 480, 87, 2, 43, "Input"], Cell[13528, 484, 58, 1, 27, "Output"], Cell[13589, 487, 58, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[13684, 493, 87, 2, 43, "Input"], Cell[13774, 497, 58, 1, 27, "Output"], Cell[13835, 500, 58, 1, 27, "Output"] }, Open ]], Cell[13908, 504, 588, 12, 187, "Input", Evaluatable->False], Cell[14499, 518, 127, 3, 27, "Input", Evaluatable->False], Cell[14629, 523, 409, 10, 91, "Input"], Cell[15041, 535, 257, 6, 27, "Input", Evaluatable->False], Cell[15301, 543, 57, 2, 27, "Input", Evaluatable->False], Cell[CellGroupData[{ Cell[15383, 549, 221, 4, 59, "Input"], Cell[15607, 555, 90, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15734, 561, 49, 1, 27, "Input"], Cell[15786, 564, 406, 12, 73, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16229, 581, 358, 6, 107, "Input"], Cell[16590, 589, 38, 1, 27, "Output"], Cell[16631, 592, 38, 1, 27, "Output"], Cell[16672, 595, 38, 1, 27, "Output"], Cell[16713, 598, 38, 1, 27, "Output"] }, Open ]], Cell[16766, 602, 368, 7, 107, "Input", Evaluatable->False], Cell[17137, 611, 107, 2, 27, "Input", Evaluatable->False], Cell[17247, 615, 375, 7, 77, "Input"], Cell[17625, 624, 165, 3, 28, "Input"], Cell[CellGroupData[{ Cell[17815, 631, 209, 3, 59, "Input"], Cell[18027, 636, 269, 4, 59, "Output"] }, Open ]], Cell[18311, 643, 209, 3, 59, "Input"], Cell[CellGroupData[{ Cell[18545, 650, 206, 3, 59, "Input"], Cell[18754, 655, 269, 4, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[19060, 664, 64, 1, 27, "Input"], Cell[19127, 667, 269, 4, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[19433, 676, 52, 1, 27, "Input"], Cell[19488, 679, 702, 16, 137, "Output"] }, Open ]], Cell[20205, 698, 150, 3, 43, "Input", Evaluatable->False] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)