[{"data":1,"prerenderedAt":2669},["ShallowReactive",2],{"blog-post-docs\u002Fccx-gate":3,"sibling-dives-docs\u002Fccx-gate":2505,"learn-track-docs\u002Fccx-gate":2506,"learn-docs-groups":2507},{"id":4,"title":5,"authors":6,"body":7,"breadcrumb":6,"builders":6,"byline":6,"category":2486,"categoryName":2487,"challenge":6,"courseAuthor":6,"courseLead":6,"dek":6,"description":2488,"draft":2489,"extension":2490,"eyebrow":6,"featured":2489,"finish":6,"fork":6,"group":2491,"groupName":2492,"hero":6,"heroAlt":6,"heroCta":6,"heroImage":6,"homepageFeatured":2489,"kind":2493,"lessonCount":6,"meta":2494,"navigation":2158,"newsItems":6,"next":6,"ogImage":6,"order":2495,"outcomes":6,"path":2496,"publishDate":2497,"readingTime":6,"related":2498,"relatedProjects":6,"seo":2499,"stem":2502,"tags":2503,"track":6,"trackName":6,"__hash__":2504},"blog\u002Fblog\u002Flearn\u002Fdocs\u002Fccx-gate.md","CCX gate",null,{"type":8,"value":9,"toc":2477},"minimark",[10,81,129,134,194,209,213,470,2000,2004,2076,2115,2119,2122,2126,2274,2419,2425,2429,2444,2448,2473],[11,12,13,14,75,76,80],"p",{},"The CCX gate, the Toffoli, flips the target qubit when both control qubits are ",[15,16,19,52],"span",{"className":17},[18],"katex",[15,20,23],{"className":21},[22],"katex-mathml",[24,25,27],"math",{"xmlns":26},"http:\u002F\u002Fwww.w3.org\u002F1998\u002FMath\u002FMathML",[28,29,30,47],"semantics",{},[31,32,33,38,42],"mrow",{},[34,35,37],"mi",{"mathvariant":36},"normal","∣",[39,40,41],"mn",{},"1",[43,44,46],"mo",{"stretchy":45},"false","⟩",[48,49,51],"annotation",{"encoding":50},"application\u002Fx-tex","\\vert 1 \\rangle",[15,53,57],{"className":54,"ariaHidden":56},[55],"katex-html","true",[15,58,61,66,71],{"className":59},[60],"base",[15,62],{"className":63,"style":65},[64],"strut","height:1em;vertical-align:-0.25em;",[15,67,70],{"className":68},[69],"mord","∣1",[15,72,46],{"className":73},[74],"mclose"," and leaves it unchanged otherwise. It acts on three qubits and takes no parameters. The Circuit panel draws a dot on each control wire joined to an ",[77,78,79],"strong",{},"X"," box on the target wire.",[11,82,83,84,122,123,128],{},"Kets such as ",[15,85,87,106],{"className":86},[18],[15,88,90],{"className":89},[22],[24,91,92],{"xmlns":26},[28,93,94,103],{},[31,95,96,98,101],{},[34,97,37],{"mathvariant":36},[39,99,100],{},"0",[43,102,46],{"stretchy":45},[48,104,105],{"encoding":50},"\\vert 0 \\rangle",[15,107,109],{"className":108,"ariaHidden":56},[55],[15,110,112,115,119],{"className":111},[60],[15,113],{"className":114,"style":65},[64],[15,116,118],{"className":117},[69],"∣0",[15,120,46],{"className":121},[74]," name the basis states and rotations are described on the Bloch sphere; the ",[124,125,127],"a",{"href":126},"\u002Flearn\u002Fquantum-foundations\u002Fqubits","qubits lesson"," introduces both.",[130,131,133],"h2",{"id":132},"call","Call",[135,136,137,149],"table",{},[138,139,140],"thead",{},[141,142,143,147],"tr",{},[144,145,146],"th",{},"Where",[144,148,133],{},[150,151,152,164,174,184],"tbody",{},[141,153,154,158],{},[155,156,157],"td",{},"Python",[155,159,160],{},[161,162,163],"code",{},"qc.ccx(control1, control2, target)",[141,165,166,169],{},[155,167,168],{},"JS",[155,170,171],{},[161,172,173],{},"circuit.ccx(control1, control2, target)",[141,175,176,179],{},[155,177,178],{},"Qiskit class",[155,180,181],{},[161,182,183],{},"CCXGate",[141,185,186,189],{},[155,187,188],{},"More controls",[155,190,191],{},[161,192,193],{},"mcx([controls], target)",[11,195,196,199,200,203,204,208],{},[161,197,198],{},"mcx"," takes a list of any number of controls. IonQ backends accept up to seven; more than that fails at submission with ",[161,201,202],{},"TooManyControls",", listed in the ",[124,205,207],{"href":206},"\u002Flearn\u002Fdocs\u002Ferror-reference","Error reference",".",[130,210,212],{"id":211},"matrix","Matrix",[11,214,215,216,391,392,430,431,469],{},"The matrix uses the basis order ",[15,217,219,259],{"className":218},[18],[15,220,222],{"className":221},[22],[24,223,224],{"xmlns":26},[28,225,226,256],{},[31,227,228,230,239,242,249,251,254],{},[34,229,37],{"mathvariant":36},[231,232,233,237],"msub",{},[234,235,236],"mtext",{},"control",[39,238,41],{},[234,240,241],{},"  ",[231,243,244,246],{},[234,245,236],{},[39,247,248],{},"2",[234,250,241],{},[234,252,253],{},"target",[43,255,46],{"stretchy":45},[48,257,258],{"encoding":50},"\\vert \\text{control}_1\\;\\text{control}_2\\;\\text{target} \\rangle",[15,260,262],{"className":261,"ariaHidden":56},[55],[15,263,265,268,271,331,336,379,382,388],{"className":264},[60],[15,266],{"className":267,"style":65},[64],[15,269,37],{"className":270},[69],[15,272,274,281],{"className":273},[69],[15,275,278],{"className":276},[69,277],"text",[15,279,236],{"className":280},[69],[15,282,285],{"className":283},[284],"msupsub",[15,286,290,322],{"className":287},[288,289],"vlist-t","vlist-t2",[15,291,294,317],{"className":292},[293],"vlist-r",[15,295,299],{"className":296,"style":298},[297],"vlist","height:0.3011em;",[15,300,302,307],{"style":301},"top:-2.55em;margin-right:0.05em;",[15,303],{"className":304,"style":306},[305],"pstrut","height:2.7em;",[15,308,314],{"className":309},[310,311,312,313],"sizing","reset-size6","size3","mtight",[15,315,41],{"className":316},[69,313],[15,318,321],{"className":319},[320],"vlist-s","​",[15,323,325],{"className":324},[293],[15,326,329],{"className":327,"style":328},[297],"height:0.15em;",[15,330],{},[15,332],{"className":333,"style":335},[334],"mspace","margin-right:0.2778em;",[15,337,339,345],{"className":338},[69],[15,340,342],{"className":341},[69,277],[15,343,236],{"className":344},[69],[15,346,348],{"className":347},[284],[15,349,351,371],{"className":350},[288,289],[15,352,354,368],{"className":353},[293],[15,355,357],{"className":356,"style":298},[297],[15,358,359,362],{"style":301},[15,360],{"className":361,"style":306},[305],[15,363,365],{"className":364},[310,311,312,313],[15,366,248],{"className":367},[69,313],[15,369,321],{"className":370},[320],[15,372,374],{"className":373},[293],[15,375,377],{"className":376,"style":328},[297],[15,378],{},[15,380],{"className":381,"style":335},[334],[15,383,385],{"className":384},[69,277],[15,386,253],{"className":387},[69],[15,389,46],{"className":390},[74]," from ",[15,393,395,414],{"className":394},[18],[15,396,398],{"className":397},[22],[24,399,400],{"xmlns":26},[28,401,402,411],{},[31,403,404,406,409],{},[34,405,37],{"mathvariant":36},[39,407,408],{},"000",[43,410,46],{"stretchy":45},[48,412,413],{"encoding":50},"\\vert 000 \\rangle",[15,415,417],{"className":416,"ariaHidden":56},[55],[15,418,420,423,427],{"className":419},[60],[15,421],{"className":422,"style":65},[64],[15,424,426],{"className":425},[69],"∣000",[15,428,46],{"className":429},[74]," to ",[15,432,434,453],{"className":433},[18],[15,435,437],{"className":436},[22],[24,438,439],{"xmlns":26},[28,440,441,450],{},[31,442,443,445,448],{},[34,444,37],{"mathvariant":36},[39,446,447],{},"111",[43,449,46],{"stretchy":45},[48,451,452],{"encoding":50},"\\vert 111 \\rangle",[15,454,456],{"className":455,"ariaHidden":56},[55],[15,457,459,462,466],{"className":458},[60],[15,460],{"className":461,"style":65},[64],[15,463,465],{"className":464},[69],"∣111",[15,467,46],{"className":468},[74],"; CCX is the identity with its last two rows swapped.",[15,471,474],{"className":472},[473],"katex-display",[15,475,477,917],{"className":476},[18],[15,478,480],{"className":479},[22],[24,481,483],{"xmlns":26,"display":482},"block",[28,484,485,914],{},[31,486,487,490,492,494,497],{},[34,488,489],{},"C",[34,491,489],{},[34,493,79],{},[43,495,496],{},"=",[31,498,499,502,911],{},[43,500,501],{"fence":56},"(",[503,504,508,561,611,661,711,761,811,861],"mtable",{"rowspacing":505,"columnalign":506,"columnspacing":507},"0.16em","center center center center center center center center","1em",[509,510,511,519,525,531,537,543,549,555],"mtr",{},[512,513,514],"mtd",{},[515,516,517],"mstyle",{"scriptlevel":100,"displaystyle":45},[39,518,41],{},[512,520,521],{},[515,522,523],{"scriptlevel":100,"displaystyle":45},[39,524,100],{},[512,526,527],{},[515,528,529],{"scriptlevel":100,"displaystyle":45},[39,530,100],{},[512,532,533],{},[515,534,535],{"scriptlevel":100,"displaystyle":45},[39,536,100],{},[512,538,539],{},[515,540,541],{"scriptlevel":100,"displaystyle":45},[39,542,100],{},[512,544,545],{},[515,546,547],{"scriptlevel":100,"displaystyle":45},[39,548,100],{},[512,550,551],{},[515,552,553],{"scriptlevel":100,"displaystyle":45},[39,554,100],{},[512,556,557],{},[515,558,559],{"scriptlevel":100,"displaystyle":45},[39,560,100],{},[509,562,563,569,575,581,587,593,599,605],{},[512,564,565],{},[515,566,567],{"scriptlevel":100,"displaystyle":45},[39,568,100],{},[512,570,571],{},[515,572,573],{"scriptlevel":100,"displaystyle":45},[39,574,41],{},[512,576,577],{},[515,578,579],{"scriptlevel":100,"displaystyle":45},[39,580,100],{},[512,582,583],{},[515,584,585],{"scriptlevel":100,"displaystyle":45},[39,586,100],{},[512,588,589],{},[515,590,591],{"scriptlevel":100,"displaystyle":45},[39,592,100],{},[512,594,595],{},[515,596,597],{"scriptlevel":100,"displaystyle":45},[39,598,100],{},[512,600,601],{},[515,602,603],{"scriptlevel":100,"displaystyle":45},[39,604,100],{},[512,606,607],{},[515,608,609],{"scriptlevel":100,"displaystyle":45},[39,610,100],{},[509,612,613,619,625,631,637,643,649,655],{},[512,614,615],{},[515,616,617],{"scriptlevel":100,"displaystyle":45},[39,618,100],{},[512,620,621],{},[515,622,623],{"scriptlevel":100,"displaystyle":45},[39,624,100],{},[512,626,627],{},[515,628,629],{"scriptlevel":100,"displaystyle":45},[39,630,41],{},[512,632,633],{},[515,634,635],{"scriptlevel":100,"displaystyle":45},[39,636,100],{},[512,638,639],{},[515,640,641],{"scriptlevel":100,"displaystyle":45},[39,642,100],{},[512,644,645],{},[515,646,647],{"scriptlevel":100,"displaystyle":45},[39,648,100],{},[512,650,651],{},[515,652,653],{"scriptlevel":100,"displaystyle":45},[39,654,100],{},[512,656,657],{},[515,658,659],{"scriptlevel":100,"displaystyle":45},[39,660,100],{},[509,662,663,669,675,681,687,693,699,705],{},[512,664,665],{},[515,666,667],{"scriptlevel":100,"displaystyle":45},[39,668,100],{},[512,670,671],{},[515,672,673],{"scriptlevel":100,"displaystyle":45},[39,674,100],{},[512,676,677],{},[515,678,679],{"scriptlevel":100,"displaystyle":45},[39,680,100],{},[512,682,683],{},[515,684,685],{"scriptlevel":100,"displaystyle":45},[39,686,41],{},[512,688,689],{},[515,690,691],{"scriptlevel":100,"displaystyle":45},[39,692,100],{},[512,694,695],{},[515,696,697],{"scriptlevel":100,"displaystyle":45},[39,698,100],{},[512,700,701],{},[515,702,703],{"scriptlevel":100,"displaystyle":45},[39,704,100],{},[512,706,707],{},[515,708,709],{"scriptlevel":100,"displaystyle":45},[39,710,100],{},[509,712,713,719,725,731,737,743,749,755],{},[512,714,715],{},[515,716,717],{"scriptlevel":100,"displaystyle":45},[39,718,100],{},[512,720,721],{},[515,722,723],{"scriptlevel":100,"displaystyle":45},[39,724,100],{},[512,726,727],{},[515,728,729],{"scriptlevel":100,"displaystyle":45},[39,730,100],{},[512,732,733],{},[515,734,735],{"scriptlevel":100,"displaystyle":45},[39,736,100],{},[512,738,739],{},[515,740,741],{"scriptlevel":100,"displaystyle":45},[39,742,41],{},[512,744,745],{},[515,746,747],{"scriptlevel":100,"displaystyle":45},[39,748,100],{},[512,750,751],{},[515,752,753],{"scriptlevel":100,"displaystyle":45},[39,754,100],{},[512,756,757],{},[515,758,759],{"scriptlevel":100,"displaystyle":45},[39,760,100],{},[509,762,763,769,775,781,787,793,799,805],{},[512,764,765],{},[515,766,767],{"scriptlevel":100,"displaystyle":45},[39,768,100],{},[512,770,771],{},[515,772,773],{"scriptlevel":100,"displaystyle":45},[39,774,100],{},[512,776,777],{},[515,778,779],{"scriptlevel":100,"displaystyle":45},[39,780,100],{},[512,782,783],{},[515,784,785],{"scriptlevel":100,"displaystyle":45},[39,786,100],{},[512,788,789],{},[515,790,791],{"scriptlevel":100,"displaystyle":45},[39,792,100],{},[512,794,795],{},[515,796,797],{"scriptlevel":100,"displaystyle":45},[39,798,41],{},[512,800,801],{},[515,802,803],{"scriptlevel":100,"displaystyle":45},[39,804,100],{},[512,806,807],{},[515,808,809],{"scriptlevel":100,"displaystyle":45},[39,810,100],{},[509,812,813,819,825,831,837,843,849,855],{},[512,814,815],{},[515,816,817],{"scriptlevel":100,"displaystyle":45},[39,818,100],{},[512,820,821],{},[515,822,823],{"scriptlevel":100,"displaystyle":45},[39,824,100],{},[512,826,827],{},[515,828,829],{"scriptlevel":100,"displaystyle":45},[39,830,100],{},[512,832,833],{},[515,834,835],{"scriptlevel":100,"displaystyle":45},[39,836,100],{},[512,838,839],{},[515,840,841],{"scriptlevel":100,"displaystyle":45},[39,842,100],{},[512,844,845],{},[515,846,847],{"scriptlevel":100,"displaystyle":45},[39,848,100],{},[512,850,851],{},[515,852,853],{"scriptlevel":100,"displaystyle":45},[39,854,100],{},[512,856,857],{},[515,858,859],{"scriptlevel":100,"displaystyle":45},[39,860,41],{},[509,862,863,869,875,881,887,893,899,905],{},[512,864,865],{},[515,866,867],{"scriptlevel":100,"displaystyle":45},[39,868,100],{},[512,870,871],{},[515,872,873],{"scriptlevel":100,"displaystyle":45},[39,874,100],{},[512,876,877],{},[515,878,879],{"scriptlevel":100,"displaystyle":45},[39,880,100],{},[512,882,883],{},[515,884,885],{"scriptlevel":100,"displaystyle":45},[39,886,100],{},[512,888,889],{},[515,890,891],{"scriptlevel":100,"displaystyle":45},[39,892,100],{},[512,894,895],{},[515,896,897],{"scriptlevel":100,"displaystyle":45},[39,898,100],{},[512,900,901],{},[515,902,903],{"scriptlevel":100,"displaystyle":45},[39,904,41],{},[512,906,907],{},[515,908,909],{"scriptlevel":100,"displaystyle":45},[39,910,100],{},[43,912,913],{"fence":56},")",[48,915,916],{"encoding":50},"CCX = \\begin{pmatrix}\n1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\\\\n0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\\\\n0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\\\\n0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\\\\n0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\\\\n0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\n\\end{pmatrix}",[15,918,920,949],{"className":919,"ariaHidden":56},[55],[15,921,923,927,932,935,939,942,946],{"className":922},[60],[15,924],{"className":925,"style":926},[64],"height:0.6833em;",[15,928,489],{"className":929,"style":931},[69,930],"mathnormal","margin-right:0.0715em;",[15,933,489],{"className":934,"style":931},[69,930],[15,936,79],{"className":937,"style":938},[69,930],"margin-right:0.0785em;",[15,940],{"className":941,"style":335},[334],[15,943,496],{"className":944},[945],"mrel",[15,947],{"className":948,"style":335},[334],[15,950,952,956],{"className":951},[60],[15,953],{"className":954,"style":955},[64],"height:9.6001em;vertical-align:-4.5501em;",[15,957,960,1012,1962],{"className":958},[959],"minner",[15,961,964],{"className":962},[963],"mopen",[15,965,969],{"className":966},[967,968],"delimsizing","mult",[15,970,972,1003],{"className":971},[288,289],[15,973,975,1000],{"className":974},[293],[15,976,979],{"className":977,"style":978},[297],"height:5.0499em;",[15,980,982,986],{"style":981},"top:-7.0499em;",[15,983],{"className":984,"style":985},[305],"height:11.6em;",[15,987,989],{"style":988},"width:0.875em;height:9.6em;",[990,991,996],"svg",{"xmlns":992,"width":993,"height":994,"viewBox":995},"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","0.875em","9.6em","0 0 875 9600",[997,998],"path",{"d":999},"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,6084c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-6092c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z",[15,1001,321],{"className":1002},[320],[15,1004,1006],{"className":1005},[293],[15,1007,1010],{"className":1008,"style":1009},[297],"height:4.5501em;",[15,1011],{},[15,1013,1015],{"className":1014},[69],[15,1016,1018,1141,1146,1149,1260,1263,1266,1377,1380,1383,1494,1497,1500,1611,1614,1617,1728,1731,1734,1845,1848,1851],{"className":1017},[503],[15,1019,1022],{"className":1020},[1021],"col-align-c",[15,1023,1025,1132],{"className":1024},[288,289],[15,1026,1028,1129],{"className":1027},[293],[15,1029,1032,1045,1057,1069,1081,1093,1105,1117],{"className":1030,"style":1031},[297],"height:5.05em;",[15,1033,1035,1039],{"style":1034},"top:-7.21em;",[15,1036],{"className":1037,"style":1038},[305],"height:3em;",[15,1040,1042],{"className":1041},[69],[15,1043,41],{"className":1044},[69],[15,1046,1048,1051],{"style":1047},"top:-6.01em;",[15,1049],{"className":1050,"style":1038},[305],[15,1052,1054],{"className":1053},[69],[15,1055,100],{"className":1056},[69],[15,1058,1060,1063],{"style":1059},"top:-4.81em;",[15,1061],{"className":1062,"style":1038},[305],[15,1064,1066],{"className":1065},[69],[15,1067,100],{"className":1068},[69],[15,1070,1072,1075],{"style":1071},"top:-3.61em;",[15,1073],{"className":1074,"style":1038},[305],[15,1076,1078],{"className":1077},[69],[15,1079,100],{"className":1080},[69],[15,1082,1084,1087],{"style":1083},"top:-2.41em;",[15,1085],{"className":1086,"style":1038},[305],[15,1088,1090],{"className":1089},[69],[15,1091,100],{"className":1092},[69],[15,1094,1096,1099],{"style":1095},"top:-1.21em;",[15,1097],{"className":1098,"style":1038},[305],[15,1100,1102],{"className":1101},[69],[15,1103,100],{"className":1104},[69],[15,1106,1108,1111],{"style":1107},"top:-0.01em;",[15,1109],{"className":1110,"style":1038},[305],[15,1112,1114],{"className":1113},[69],[15,1115,100],{"className":1116},[69],[15,1118,1120,1123],{"style":1119},"top:1.19em;",[15,1121],{"className":1122,"style":1038},[305],[15,1124,1126],{"className":1125},[69],[15,1127,100],{"className":1128},[69],[15,1130,321],{"className":1131},[320],[15,1133,1135],{"className":1134},[293],[15,1136,1139],{"className":1137,"style":1138},[297],"height:4.55em;",[15,1140],{},[15,1142],{"className":1143,"style":1145},[1144],"arraycolsep","width:0.5em;",[15,1147],{"className":1148,"style":1145},[1144],[15,1150,1152],{"className":1151},[1021],[15,1153,1155,1252],{"className":1154},[288,289],[15,1156,1158,1249],{"className":1157},[293],[15,1159,1161,1172,1183,1194,1205,1216,1227,1238],{"className":1160,"style":1031},[297],[15,1162,1163,1166],{"style":1034},[15,1164],{"className":1165,"style":1038},[305],[15,1167,1169],{"className":1168},[69],[15,1170,100],{"className":1171},[69],[15,1173,1174,1177],{"style":1047},[15,1175],{"className":1176,"style":1038},[305],[15,1178,1180],{"className":1179},[69],[15,1181,41],{"className":1182},[69],[15,1184,1185,1188],{"style":1059},[15,1186],{"className":1187,"style":1038},[305],[15,1189,1191],{"className":1190},[69],[15,1192,100],{"className":1193},[69],[15,1195,1196,1199],{"style":1071},[15,1197],{"className":1198,"style":1038},[305],[15,1200,1202],{"className":1201},[69],[15,1203,100],{"className":1204},[69],[15,1206,1207,1210],{"style":1083},[15,1208],{"className":1209,"style":1038},[305],[15,1211,1213],{"className":1212},[69],[15,1214,100],{"className":1215},[69],[15,1217,1218,1221],{"style":1095},[15,1219],{"className":1220,"style":1038},[305],[15,1222,1224],{"className":1223},[69],[15,1225,100],{"className":1226},[69],[15,1228,1229,1232],{"style":1107},[15,1230],{"className":1231,"style":1038},[305],[15,1233,1235],{"className":1234},[69],[15,1236,100],{"className":1237},[69],[15,1239,1240,1243],{"style":1119},[15,1241],{"className":1242,"style":1038},[305],[15,1244,1246],{"className":1245},[69],[15,1247,100],{"className":1248},[69],[15,1250,321],{"className":1251},[320],[15,1253,1255],{"className":1254},[293],[15,1256,1258],{"className":1257,"style":1138},[297],[15,1259],{},[15,1261],{"className":1262,"style":1145},[1144],[15,1264],{"className":1265,"style":1145},[1144],[15,1267,1269],{"className":1268},[1021],[15,1270,1272,1369],{"className":1271},[288,289],[15,1273,1275,1366],{"className":1274},[293],[15,1276,1278,1289,1300,1311,1322,1333,1344,1355],{"className":1277,"style":1031},[297],[15,1279,1280,1283],{"style":1034},[15,1281],{"className":1282,"style":1038},[305],[15,1284,1286],{"className":1285},[69],[15,1287,100],{"className":1288},[69],[15,1290,1291,1294],{"style":1047},[15,1292],{"className":1293,"style":1038},[305],[15,1295,1297],{"className":1296},[69],[15,1298,100],{"className":1299},[69],[15,1301,1302,1305],{"style":1059},[15,1303],{"className":1304,"style":1038},[305],[15,1306,1308],{"className":1307},[69],[15,1309,41],{"className":1310},[69],[15,1312,1313,1316],{"style":1071},[15,1314],{"className":1315,"style":1038},[305],[15,1317,1319],{"className":1318},[69],[15,1320,100],{"className":1321},[69],[15,1323,1324,1327],{"style":1083},[15,1325],{"className":1326,"style":1038},[305],[15,1328,1330],{"className":1329},[69],[15,1331,100],{"className":1332},[69],[15,1334,1335,1338],{"style":1095},[15,1336],{"className":1337,"style":1038},[305],[15,1339,1341],{"className":1340},[69],[15,1342,100],{"className":1343},[69],[15,1345,1346,1349],{"style":1107},[15,1347],{"className":1348,"style":1038},[305],[15,1350,1352],{"className":1351},[69],[15,1353,100],{"className":1354},[69],[15,1356,1357,1360],{"style":1119},[15,1358],{"className":1359,"style":1038},[305],[15,1361,1363],{"className":1362},[69],[15,1364,100],{"className":1365},[69],[15,1367,321],{"className":1368},[320],[15,1370,1372],{"className":1371},[293],[15,1373,1375],{"className":1374,"style":1138},[297],[15,1376],{},[15,1378],{"className":1379,"style":1145},[1144],[15,1381],{"className":1382,"style":1145},[1144],[15,1384,1386],{"className":1385},[1021],[15,1387,1389,1486],{"className":1388},[288,289],[15,1390,1392,1483],{"className":1391},[293],[15,1393,1395,1406,1417,1428,1439,1450,1461,1472],{"className":1394,"style":1031},[297],[15,1396,1397,1400],{"style":1034},[15,1398],{"className":1399,"style":1038},[305],[15,1401,1403],{"className":1402},[69],[15,1404,100],{"className":1405},[69],[15,1407,1408,1411],{"style":1047},[15,1409],{"className":1410,"style":1038},[305],[15,1412,1414],{"className":1413},[69],[15,1415,100],{"className":1416},[69],[15,1418,1419,1422],{"style":1059},[15,1420],{"className":1421,"style":1038},[305],[15,1423,1425],{"className":1424},[69],[15,1426,100],{"className":1427},[69],[15,1429,1430,1433],{"style":1071},[15,1431],{"className":1432,"style":1038},[305],[15,1434,1436],{"className":1435},[69],[15,1437,41],{"className":1438},[69],[15,1440,1441,1444],{"style":1083},[15,1442],{"className":1443,"style":1038},[305],[15,1445,1447],{"className":1446},[69],[15,1448,100],{"className":1449},[69],[15,1451,1452,1455],{"style":1095},[15,1453],{"className":1454,"style":1038},[305],[15,1456,1458],{"className":1457},[69],[15,1459,100],{"className":1460},[69],[15,1462,1463,1466],{"style":1107},[15,1464],{"className":1465,"style":1038},[305],[15,1467,1469],{"className":1468},[69],[15,1470,100],{"className":1471},[69],[15,1473,1474,1477],{"style":1119},[15,1475],{"className":1476,"style":1038},[305],[15,1478,1480],{"className":1479},[69],[15,1481,100],{"className":1482},[69],[15,1484,321],{"className":1485},[320],[15,1487,1489],{"className":1488},[293],[15,1490,1492],{"className":1491,"style":1138},[297],[15,1493],{},[15,1495],{"className":1496,"style":1145},[1144],[15,1498],{"className":1499,"style":1145},[1144],[15,1501,1503],{"className":1502},[1021],[15,1504,1506,1603],{"className":1505},[288,289],[15,1507,1509,1600],{"className":1508},[293],[15,1510,1512,1523,1534,1545,1556,1567,1578,1589],{"className":1511,"style":1031},[297],[15,1513,1514,1517],{"style":1034},[15,1515],{"className":1516,"style":1038},[305],[15,1518,1520],{"className":1519},[69],[15,1521,100],{"className":1522},[69],[15,1524,1525,1528],{"style":1047},[15,1526],{"className":1527,"style":1038},[305],[15,1529,1531],{"className":1530},[69],[15,1532,100],{"className":1533},[69],[15,1535,1536,1539],{"style":1059},[15,1537],{"className":1538,"style":1038},[305],[15,1540,1542],{"className":1541},[69],[15,1543,100],{"className":1544},[69],[15,1546,1547,1550],{"style":1071},[15,1548],{"className":1549,"style":1038},[305],[15,1551,1553],{"className":1552},[69],[15,1554,100],{"className":1555},[69],[15,1557,1558,1561],{"style":1083},[15,1559],{"className":1560,"style":1038},[305],[15,1562,1564],{"className":1563},[69],[15,1565,41],{"className":1566},[69],[15,1568,1569,1572],{"style":1095},[15,1570],{"className":1571,"style":1038},[305],[15,1573,1575],{"className":1574},[69],[15,1576,100],{"className":1577},[69],[15,1579,1580,1583],{"style":1107},[15,1581],{"className":1582,"style":1038},[305],[15,1584,1586],{"className":1585},[69],[15,1587,100],{"className":1588},[69],[15,1590,1591,1594],{"style":1119},[15,1592],{"className":1593,"style":1038},[305],[15,1595,1597],{"className":1596},[69],[15,1598,100],{"className":1599},[69],[15,1601,321],{"className":1602},[320],[15,1604,1606],{"className":1605},[293],[15,1607,1609],{"className":1608,"style":1138},[297],[15,1610],{},[15,1612],{"className":1613,"style":1145},[1144],[15,1615],{"className":1616,"style":1145},[1144],[15,1618,1620],{"className":1619},[1021],[15,1621,1623,1720],{"className":1622},[288,289],[15,1624,1626,1717],{"className":1625},[293],[15,1627,1629,1640,1651,1662,1673,1684,1695,1706],{"className":1628,"style":1031},[297],[15,1630,1631,1634],{"style":1034},[15,1632],{"className":1633,"style":1038},[305],[15,1635,1637],{"className":1636},[69],[15,1638,100],{"className":1639},[69],[15,1641,1642,1645],{"style":1047},[15,1643],{"className":1644,"style":1038},[305],[15,1646,1648],{"className":1647},[69],[15,1649,100],{"className":1650},[69],[15,1652,1653,1656],{"style":1059},[15,1654],{"className":1655,"style":1038},[305],[15,1657,1659],{"className":1658},[69],[15,1660,100],{"className":1661},[69],[15,1663,1664,1667],{"style":1071},[15,1665],{"className":1666,"style":1038},[305],[15,1668,1670],{"className":1669},[69],[15,1671,100],{"className":1672},[69],[15,1674,1675,1678],{"style":1083},[15,1676],{"className":1677,"style":1038},[305],[15,1679,1681],{"className":1680},[69],[15,1682,100],{"className":1683},[69],[15,1685,1686,1689],{"style":1095},[15,1687],{"className":1688,"style":1038},[305],[15,1690,1692],{"className":1691},[69],[15,1693,41],{"className":1694},[69],[15,1696,1697,1700],{"style":1107},[15,1698],{"className":1699,"style":1038},[305],[15,1701,1703],{"className":1702},[69],[15,1704,100],{"className":1705},[69],[15,1707,1708,1711],{"style":1119},[15,1709],{"className":1710,"style":1038},[305],[15,1712,1714],{"className":1713},[69],[15,1715,100],{"className":1716},[69],[15,1718,321],{"className":1719},[320],[15,1721,1723],{"className":1722},[293],[15,1724,1726],{"className":1725,"style":1138},[297],[15,1727],{},[15,1729],{"className":1730,"style":1145},[1144],[15,1732],{"className":1733,"style":1145},[1144],[15,1735,1737],{"className":1736},[1021],[15,1738,1740,1837],{"className":1739},[288,289],[15,1741,1743,1834],{"className":1742},[293],[15,1744,1746,1757,1768,1779,1790,1801,1812,1823],{"className":1745,"style":1031},[297],[15,1747,1748,1751],{"style":1034},[15,1749],{"className":1750,"style":1038},[305],[15,1752,1754],{"className":1753},[69],[15,1755,100],{"className":1756},[69],[15,1758,1759,1762],{"style":1047},[15,1760],{"className":1761,"style":1038},[305],[15,1763,1765],{"className":1764},[69],[15,1766,100],{"className":1767},[69],[15,1769,1770,1773],{"style":1059},[15,1771],{"className":1772,"style":1038},[305],[15,1774,1776],{"className":1775},[69],[15,1777,100],{"className":1778},[69],[15,1780,1781,1784],{"style":1071},[15,1782],{"className":1783,"style":1038},[305],[15,1785,1787],{"className":1786},[69],[15,1788,100],{"className":1789},[69],[15,1791,1792,1795],{"style":1083},[15,1793],{"className":1794,"style":1038},[305],[15,1796,1798],{"className":1797},[69],[15,1799,100],{"className":1800},[69],[15,1802,1803,1806],{"style":1095},[15,1804],{"className":1805,"style":1038},[305],[15,1807,1809],{"className":1808},[69],[15,1810,100],{"className":1811},[69],[15,1813,1814,1817],{"style":1107},[15,1815],{"className":1816,"style":1038},[305],[15,1818,1820],{"className":1819},[69],[15,1821,100],{"className":1822},[69],[15,1824,1825,1828],{"style":1119},[15,1826],{"className":1827,"style":1038},[305],[15,1829,1831],{"className":1830},[69],[15,1832,41],{"className":1833},[69],[15,1835,321],{"className":1836},[320],[15,1838,1840],{"className":1839},[293],[15,1841,1843],{"className":1842,"style":1138},[297],[15,1844],{},[15,1846],{"className":1847,"style":1145},[1144],[15,1849],{"className":1850,"style":1145},[1144],[15,1852,1854],{"className":1853},[1021],[15,1855,1857,1954],{"className":1856},[288,289],[15,1858,1860,1951],{"className":1859},[293],[15,1861,1863,1874,1885,1896,1907,1918,1929,1940],{"className":1862,"style":1031},[297],[15,1864,1865,1868],{"style":1034},[15,1866],{"className":1867,"style":1038},[305],[15,1869,1871],{"className":1870},[69],[15,1872,100],{"className":1873},[69],[15,1875,1876,1879],{"style":1047},[15,1877],{"className":1878,"style":1038},[305],[15,1880,1882],{"className":1881},[69],[15,1883,100],{"className":1884},[69],[15,1886,1887,1890],{"style":1059},[15,1888],{"className":1889,"style":1038},[305],[15,1891,1893],{"className":1892},[69],[15,1894,100],{"className":1895},[69],[15,1897,1898,1901],{"style":1071},[15,1899],{"className":1900,"style":1038},[305],[15,1902,1904],{"className":1903},[69],[15,1905,100],{"className":1906},[69],[15,1908,1909,1912],{"style":1083},[15,1910],{"className":1911,"style":1038},[305],[15,1913,1915],{"className":1914},[69],[15,1916,100],{"className":1917},[69],[15,1919,1920,1923],{"style":1095},[15,1921],{"className":1922,"style":1038},[305],[15,1924,1926],{"className":1925},[69],[15,1927,100],{"className":1928},[69],[15,1930,1931,1934],{"style":1107},[15,1932],{"className":1933,"style":1038},[305],[15,1935,1937],{"className":1936},[69],[15,1938,41],{"className":1939},[69],[15,1941,1942,1945],{"style":1119},[15,1943],{"className":1944,"style":1038},[305],[15,1946,1948],{"className":1947},[69],[15,1949,100],{"className":1950},[69],[15,1952,321],{"className":1953},[320],[15,1955,1957],{"className":1956},[293],[15,1958,1960],{"className":1959,"style":1138},[297],[15,1961],{},[15,1963,1965],{"className":1964},[74],[15,1966,1968],{"className":1967},[967,968],[15,1969,1971,1992],{"className":1970},[288,289],[15,1972,1974,1989],{"className":1973},[293],[15,1975,1977],{"className":1976,"style":978},[297],[15,1978,1979,1982],{"style":981},[15,1980],{"className":1981,"style":985},[305],[15,1983,1984],{"style":988},[990,1985,1986],{"xmlns":992,"width":993,"height":994,"viewBox":995},[997,1987],{"d":1988},"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,6009\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-6144c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z",[15,1990,321],{"className":1991},[320],[15,1993,1995],{"className":1994},[293],[15,1996,1998],{"className":1997,"style":1009},[297],[15,1999],{},[130,2001,2003],{"id":2002},"effect-on-basis-states","Effect on basis states",[135,2005,2006,2022],{},[138,2007,2008],{},[141,2009,2010,2013,2016,2019],{},[144,2011,2012],{},"Control 1",[144,2014,2015],{},"Control 2",[144,2017,2018],{},"Target",[144,2020,2021],{},"Target after",[150,2023,2024,2036,2046,2056,2066],{},[141,2025,2026,2028,2030,2033],{},[155,2027,100],{},[155,2029,100],{},[155,2031,2032],{},"any",[155,2034,2035],{},"unchanged",[141,2037,2038,2040,2042,2044],{},[155,2039,100],{},[155,2041,41],{},[155,2043,2032],{},[155,2045,2035],{},[141,2047,2048,2050,2052,2054],{},[155,2049,41],{},[155,2051,100],{},[155,2053,2032],{},[155,2055,2035],{},[141,2057,2058,2060,2062,2064],{},[155,2059,41],{},[155,2061,41],{},[155,2063,100],{},[155,2065,41],{},[141,2067,2068,2070,2072,2074],{},[155,2069,41],{},[155,2071,41],{},[155,2073,41],{},[155,2075,100],{},[11,2077,2078,2079,2114],{},"The controls are never changed in the computational basis. With the target held at ",[15,2080,2082,2099],{"className":2081},[18],[15,2083,2085],{"className":2084},[22],[24,2086,2087],{"xmlns":26},[28,2088,2089,2097],{},[31,2090,2091,2093,2095],{},[34,2092,37],{"mathvariant":36},[39,2094,100],{},[43,2096,46],{"stretchy":45},[48,2098,105],{"encoding":50},[15,2100,2102],{"className":2101,"ariaHidden":56},[55],[15,2103,2105,2108,2111],{"className":2104},[60],[15,2106],{"className":2107,"style":65},[64],[15,2109,118],{"className":2110},[69],[15,2112,46],{"className":2113},[74],", CCX writes the AND of the two controls into it, which is what makes it a universal gate for classical logic inside a quantum circuit.",[130,2116,2118],{"id":2117},"inverse","Inverse",[11,2120,2121],{},"CCX is its own inverse. Two CCX gates in a row on the same qubits cancel.",[130,2123,2125],{"id":2124},"usage","Usage",[2127,2128,2133],"pre",{"className":2129,"code":2130,"language":2131,"meta":2132,"style":2132},"language-python shiki shiki-themes one-dark-pro","from qiskit import QuantumCircuit\n\nqc = QuantumCircuit(3, 3)\nqc.x(0)\nqc.x(1)\nqc.ccx(0, 1, 2)\nqc.measure([0, 1, 2], [0, 1, 2])\n","python","",[161,2134,2135,2153,2160,2187,2202,2215,2237],{"__ignoreMap":2132},[15,2136,2139,2143,2147,2150],{"class":2137,"line":2138},"line",1,[15,2140,2142],{"class":2141},"seHd6","from",[15,2144,2146],{"class":2145},"sn6KH"," qiskit ",[15,2148,2149],{"class":2141},"import",[15,2151,2152],{"class":2145}," QuantumCircuit\n",[15,2154,2156],{"class":2137,"line":2155},2,[15,2157,2159],{"emptyLinePlaceholder":2158},true,"\n",[15,2161,2163,2166,2169,2173,2175,2179,2182,2184],{"class":2137,"line":2162},3,[15,2164,2165],{"class":2145},"qc ",[15,2167,496],{"class":2168},"sjrmR",[15,2170,2172],{"class":2171},"sVbv2"," QuantumCircuit",[15,2174,501],{"class":2145},[15,2176,2178],{"class":2177},"sVC51","3",[15,2180,2181],{"class":2145},", ",[15,2183,2178],{"class":2177},[15,2185,2186],{"class":2145},")\n",[15,2188,2190,2193,2196,2198,2200],{"class":2137,"line":2189},4,[15,2191,2192],{"class":2145},"qc.",[15,2194,2195],{"class":2171},"x",[15,2197,501],{"class":2145},[15,2199,100],{"class":2177},[15,2201,2186],{"class":2145},[15,2203,2205,2207,2209,2211,2213],{"class":2137,"line":2204},5,[15,2206,2192],{"class":2145},[15,2208,2195],{"class":2171},[15,2210,501],{"class":2145},[15,2212,41],{"class":2177},[15,2214,2186],{"class":2145},[15,2216,2218,2220,2223,2225,2227,2229,2231,2233,2235],{"class":2137,"line":2217},6,[15,2219,2192],{"class":2145},[15,2221,2222],{"class":2171},"ccx",[15,2224,501],{"class":2145},[15,2226,100],{"class":2177},[15,2228,2181],{"class":2145},[15,2230,41],{"class":2177},[15,2232,2181],{"class":2145},[15,2234,248],{"class":2177},[15,2236,2186],{"class":2145},[15,2238,2240,2242,2245,2248,2250,2252,2254,2256,2258,2261,2263,2265,2267,2269,2271],{"class":2137,"line":2239},7,[15,2241,2192],{"class":2145},[15,2243,2244],{"class":2171},"measure",[15,2246,2247],{"class":2145},"([",[15,2249,100],{"class":2177},[15,2251,2181],{"class":2145},[15,2253,41],{"class":2177},[15,2255,2181],{"class":2145},[15,2257,248],{"class":2177},[15,2259,2260],{"class":2145},"], [",[15,2262,100],{"class":2177},[15,2264,2181],{"class":2145},[15,2266,41],{"class":2177},[15,2268,2181],{"class":2145},[15,2270,248],{"class":2177},[15,2272,2273],{"class":2145},"])\n",[2127,2275,2279],{"className":2276,"code":2277,"language":2278,"meta":2132,"style":2132},"language-js shiki shiki-themes one-dark-pro","import { QuantumCircuit } from 'qiskit';\n\nconst circuit = QuantumCircuit(3, 3);\ncircuit.x(0);\ncircuit.x(1);\ncircuit.ccx(0, 1, 2);\ncircuit.measure([0, 1, 2], [0, 1, 2]);\n","js",[161,2280,2281,2304,2308,2333,2348,2362,2384],{"__ignoreMap":2132},[15,2282,2283,2285,2288,2292,2295,2297,2301],{"class":2137,"line":2138},[15,2284,2149],{"class":2141},[15,2286,2287],{"class":2145}," { ",[15,2289,2291],{"class":2290},"sVyAn","QuantumCircuit",[15,2293,2294],{"class":2145}," } ",[15,2296,2142],{"class":2141},[15,2298,2300],{"class":2299},"subq3"," 'qiskit'",[15,2302,2303],{"class":2145},";\n",[15,2305,2306],{"class":2137,"line":2155},[15,2307,2159],{"emptyLinePlaceholder":2158},[15,2309,2310,2313,2317,2320,2322,2324,2326,2328,2330],{"class":2137,"line":2162},[15,2311,2312],{"class":2141},"const",[15,2314,2316],{"class":2315},"sU0A5"," circuit",[15,2318,2319],{"class":2168}," =",[15,2321,2172],{"class":2171},[15,2323,501],{"class":2145},[15,2325,2178],{"class":2177},[15,2327,2181],{"class":2145},[15,2329,2178],{"class":2177},[15,2331,2332],{"class":2145},");\n",[15,2334,2335,2338,2340,2342,2344,2346],{"class":2137,"line":2189},[15,2336,2337],{"class":2315},"circuit",[15,2339,208],{"class":2145},[15,2341,2195],{"class":2171},[15,2343,501],{"class":2145},[15,2345,100],{"class":2177},[15,2347,2332],{"class":2145},[15,2349,2350,2352,2354,2356,2358,2360],{"class":2137,"line":2204},[15,2351,2337],{"class":2315},[15,2353,208],{"class":2145},[15,2355,2195],{"class":2171},[15,2357,501],{"class":2145},[15,2359,41],{"class":2177},[15,2361,2332],{"class":2145},[15,2363,2364,2366,2368,2370,2372,2374,2376,2378,2380,2382],{"class":2137,"line":2217},[15,2365,2337],{"class":2315},[15,2367,208],{"class":2145},[15,2369,2222],{"class":2171},[15,2371,501],{"class":2145},[15,2373,100],{"class":2177},[15,2375,2181],{"class":2145},[15,2377,41],{"class":2177},[15,2379,2181],{"class":2145},[15,2381,248],{"class":2177},[15,2383,2332],{"class":2145},[15,2385,2386,2388,2390,2392,2394,2396,2398,2400,2402,2404,2406,2408,2410,2412,2414,2416],{"class":2137,"line":2239},[15,2387,2337],{"class":2315},[15,2389,208],{"class":2145},[15,2391,2244],{"class":2171},[15,2393,2247],{"class":2145},[15,2395,100],{"class":2177},[15,2397,2181],{"class":2145},[15,2399,41],{"class":2177},[15,2401,2181],{"class":2145},[15,2403,248],{"class":2177},[15,2405,2260],{"class":2145},[15,2407,100],{"class":2177},[15,2409,2181],{"class":2145},[15,2411,41],{"class":2177},[15,2413,2181],{"class":2145},[15,2415,248],{"class":2177},[15,2417,2418],{"class":2145},"]);\n",[11,2420,2421,2422,2424],{},"Every shot reads ",[161,2423,447],{},": both controls are 1, so the target flips.",[130,2426,2428],{"id":2427},"on-ionq-hardware","On IonQ hardware",[11,2430,2431,2432,2436,2437,2439,2440,208],{},"CCX is not a native gate and costs more than a CX. The textbook decomposition uses six ",[124,2433,2435],{"href":2434},"\u002Flearn\u002Fdocs\u002Fcx-gate","CX gates",", against one for a CX. Qollab does not submit those six: a ",[161,2438,2222],{}," goes to IonQ as a single X gate with two controls, the form IonQ recommends because a circuit expressed in fewer gates leaves its optimiser more room, and IonQ's compiler decides the two-qubit gates from there without publishing how many. See ",[124,2441,2443],{"href":2442},"\u002Flearn\u002Fdocs\u002Fhow-your-circuit-is-compiled","How your circuit is compiled",[130,2445,2447],{"id":2446},"related","Related",[2449,2450,2451,2457,2463,2469],"ul",{},[2452,2453,2454],"li",{},[124,2455,2456],{"href":2434},"CX gate",[2452,2458,2459],{},[124,2460,2462],{"href":2461},"\u002Flearn\u002Fdocs\u002Fx-gate","X gate",[2452,2464,2465],{},[124,2466,2468],{"href":2467},"\u002Flearn\u002Fdocs\u002Fgates","Gate reference",[2452,2470,2471],{},[124,2472,207],{"href":206},[2474,2475,2476],"style",{},"html pre.shiki code .seHd6, html code.shiki .seHd6{--shiki-default:#C678DD}html pre.shiki code .sn6KH, html code.shiki .sn6KH{--shiki-default:#ABB2BF}html pre.shiki code .sjrmR, html code.shiki .sjrmR{--shiki-default:#56B6C2}html pre.shiki code .sVbv2, html code.shiki .sVbv2{--shiki-default:#61AFEF}html pre.shiki code .sVC51, html code.shiki .sVC51{--shiki-default:#D19A66}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sVyAn, html code.shiki .sVyAn{--shiki-default:#E06C75}html pre.shiki code .subq3, html code.shiki .subq3{--shiki-default:#98C379}html pre.shiki code .sU0A5, html code.shiki .sU0A5{--shiki-default:#E5C07B}",{"title":2132,"searchDepth":2155,"depth":2155,"links":2478},[2479,2480,2481,2482,2483,2484,2485],{"id":132,"depth":2155,"text":133},{"id":211,"depth":2155,"text":212},{"id":2002,"depth":2155,"text":2003},{"id":2117,"depth":2155,"text":2118},{"id":2124,"depth":2155,"text":2125},{"id":2427,"depth":2155,"text":2428},{"id":2446,"depth":2155,"text":2447},"gates","Gates","The Toffoli gate: matrix, truth table, the ccx() call in Python and JS, the multi-controlled mcx(), and what it costs on IonQ hardware.",false,"md","multi-qubit","Multi-qubit gates","doc",{},23,"\u002Fblog\u002Flearn\u002Fdocs\u002Fccx-gate","2026-09-16",[],{"title":2500,"description":2501},"CCX gate (Toffoli) · Qollab docs","Reference for the Toffoli gate: matrix, truth table, the Qiskit ccx() and mcx() calls in Python and JS, the seven-control limit, and its IonQ cost.","blog\u002Flearn\u002Fdocs\u002Fccx-gate",[],"yNENhw_Md0mDnNNtkt4hpgpm9jAdK_86MP7fSbVgk08",[],[],[2508,2515,2531,2560,2648,2658],{"category":2509,"categoryName":2510,"articles":2511},"account","Account",[2512],{"title":2513,"href":2514},"Account and profile","\u002Flearn\u002Fdocs\u002Faccount-and-profile",{"category":2516,"categoryName":2517,"articles":2518},"projects","Projects",[2519,2522,2525,2528],{"title":2520,"href":2521},"The project page","\u002Flearn\u002Fdocs\u002Fproject-anatomy",{"title":2523,"href":2524},"Editing your project","\u002Flearn\u002Fdocs\u002Fwrite-your-project-page",{"title":2526,"href":2527},"Publishing and versions","\u002Flearn\u002Fdocs\u002Fpublish",{"title":2529,"href":2530},"Forking a project","\u002Flearn\u002Fdocs\u002Ffork-and-remix",{"category":2532,"categoryName":2533,"articles":2534},"running-code","Running code",[2535,2538,2541,2544,2547,2550,2551,2554,2557],{"title":2536,"href":2537},"Running your code","\u002Flearn\u002Fdocs\u002Frun-your-code",{"title":2539,"href":2540},"Compute backends","\u002Flearn\u002Fdocs\u002Fcompute-backends",{"title":2542,"href":2543},"The runtime environment","\u002Flearn\u002Fdocs\u002Fruntime-environment",{"title":2545,"href":2546},"JS \u002F Qiskit projects","\u002Flearn\u002Fdocs\u002Fjs-qiskit-projects",{"title":2548,"href":2549},"Python \u002F Qiskit projects","\u002Flearn\u002Fdocs\u002Fpython-qiskit-projects",{"title":2443,"href":2442},{"title":2552,"href":2553},"Error mitigation and debiasing","\u002Flearn\u002Fdocs\u002Ferror-mitigation",{"title":2555,"href":2556},"Transpilation","\u002Flearn\u002Fdocs\u002Ftranspilation",{"title":2558,"href":2559},"Primitives","\u002Flearn\u002Fdocs\u002Fprimitives",{"category":2486,"categoryName":2487,"articles":2561},[2562,2563,2568,2569,2572,2575,2578,2581,2584,2587,2590,2593,2596,2599,2602,2605,2608,2611,2614,2617,2620,2623,2626,2629,2631,2634,2639,2642,2645],{"title":2468,"href":2467},{"title":2564,"href":2565,"group":2566,"groupName":2567},"H gate","\u002Flearn\u002Fdocs\u002Fh-gate","single-qubit","Single-qubit gates",{"title":2462,"href":2461,"group":2566,"groupName":2567},{"title":2570,"href":2571,"group":2566,"groupName":2567},"Y gate","\u002Flearn\u002Fdocs\u002Fy-gate",{"title":2573,"href":2574,"group":2566,"groupName":2567},"Z gate","\u002Flearn\u002Fdocs\u002Fz-gate",{"title":2576,"href":2577,"group":2566,"groupName":2567},"S gate","\u002Flearn\u002Fdocs\u002Fs-gate",{"title":2579,"href":2580,"group":2566,"groupName":2567},"Sdg gate","\u002Flearn\u002Fdocs\u002Fsdg-gate",{"title":2582,"href":2583,"group":2566,"groupName":2567},"T gate","\u002Flearn\u002Fdocs\u002Ft-gate",{"title":2585,"href":2586,"group":2566,"groupName":2567},"Tdg gate","\u002Flearn\u002Fdocs\u002Ftdg-gate",{"title":2588,"href":2589,"group":2566,"groupName":2567},"√X gate","\u002Flearn\u002Fdocs\u002Fsx-gate",{"title":2591,"href":2592,"group":2566,"groupName":2567},"√X† gate","\u002Flearn\u002Fdocs\u002Fsxdg-gate",{"title":2594,"href":2595,"group":2566,"groupName":2567},"P gate","\u002Flearn\u002Fdocs\u002Fp-gate",{"title":2597,"href":2598,"group":2566,"groupName":2567},"RX gate","\u002Flearn\u002Fdocs\u002Frx-gate",{"title":2600,"href":2601,"group":2566,"groupName":2567},"RY gate","\u002Flearn\u002Fdocs\u002Fry-gate",{"title":2603,"href":2604,"group":2566,"groupName":2567},"RZ gate","\u002Flearn\u002Fdocs\u002Frz-gate",{"title":2456,"href":2434,"group":2606,"groupName":2607},"two-qubit","Two-qubit gates",{"title":2609,"href":2610,"group":2606,"groupName":2607},"CY gate","\u002Flearn\u002Fdocs\u002Fcy-gate",{"title":2612,"href":2613,"group":2606,"groupName":2607},"CZ gate","\u002Flearn\u002Fdocs\u002Fcz-gate",{"title":2615,"href":2616,"group":2606,"groupName":2607},"CP gate","\u002Flearn\u002Fdocs\u002Fcp-gate",{"title":2618,"href":2619,"group":2606,"groupName":2607},"Swap gate","\u002Flearn\u002Fdocs\u002Fswap-gate",{"title":2621,"href":2622,"group":2606,"groupName":2607},"RXX gate","\u002Flearn\u002Fdocs\u002Frxx-gate",{"title":2624,"href":2625,"group":2606,"groupName":2607},"RYY gate","\u002Flearn\u002Fdocs\u002Fryy-gate",{"title":2627,"href":2628,"group":2606,"groupName":2607},"RZZ gate","\u002Flearn\u002Fdocs\u002Frzz-gate",{"title":5,"href":2630,"group":2491,"groupName":2492},"\u002Flearn\u002Fdocs\u002Fccx-gate",{"title":2632,"href":2633,"group":2491,"groupName":2492},"Pauli evolution gate","\u002Flearn\u002Fdocs\u002Fpauli-evolution-gate",{"title":2635,"href":2636,"group":2637,"groupName":2638},"GPi gate","\u002Flearn\u002Fdocs\u002Fgpi-gate","native","IonQ native gates",{"title":2640,"href":2641,"group":2637,"groupName":2638},"GPi2 gate","\u002Flearn\u002Fdocs\u002Fgpi2-gate",{"title":2643,"href":2644,"group":2637,"groupName":2638},"MS gate","\u002Flearn\u002Fdocs\u002Fms-gate",{"title":2646,"href":2647,"group":2637,"groupName":2638},"ZZ gate","\u002Flearn\u002Fdocs\u002Fzz-gate",{"category":2649,"categoryName":2650,"articles":2651},"credits","Credits",[2652,2655],{"title":2653,"href":2654},"How credits work","\u002Flearn\u002Fdocs\u002Fhow-credits-work",{"title":2656,"href":2657},"Before you spend credits","\u002Flearn\u002Fdocs\u002Fbefore-you-spend-credits",{"category":2659,"categoryName":2660,"articles":2661},"troubleshooting","Troubleshooting",[2662,2665,2666],{"title":2663,"href":2664},"Troubleshooting and FAQ","\u002Flearn\u002Fdocs\u002Ffaq",{"title":207,"href":206},{"title":2667,"href":2668},"Why your results look wrong","\u002Flearn\u002Fdocs\u002Fwhy-your-results-look-wrong",1789652389871]