{"id":1724,"date":"2023-10-17T10:17:25","date_gmt":"2023-10-17T14:17:25","guid":{"rendered":"https:\/\/blogs.mathworks.com\/matlab\/?p=1724"},"modified":"2024-02-08T11:03:01","modified_gmt":"2024-02-08T16:03:01","slug":"quantum-computing-in-matlab-r2023b-on-the-desktop-and-in-the-cloud","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/matlab\/2023\/10\/17\/quantum-computing-in-matlab-r2023b-on-the-desktop-and-in-the-cloud\/","title":{"rendered":"Quantum computing in MATLAB R2023b: On the desktop and in the cloud"},"content":{"rendered":"<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Back in May of this year i attended the <\/span><a href = \"https:\/\/www.isc-hpc.com\/\"><span>ISC High Performance Computing conference<\/span><\/a><span> with a few other colleagues from MathWorks and was astonished at the number of booths related to various quantum computing intitiatives. I had more conversations about quantum computing in those few days than I'd had in years leading up to the event! As such, it seems rather timely that it's now possible to do quantum computing in MATLAB.<\/span><\/div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Getting started with quantum computing in MATLAB<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The MATLAB Support Package for Quantum Computing is a free add-on developed by MathWorks. There are several ways to install it but my preferred way is via the <\/span><a href = \"https:\/\/www.mathworks.com\/products\/matlab\/add-on-explorer.html\"><span>Add-on Explorer<\/span><\/a><span>. <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_1.png\" width = \"371\" height = \"194\" alt = \"\" style = \"vertical-align: baseline; width: 371px; height: 194px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Once in Add-on explorer, just search for quantum computing and you'll find it. Another way to get it is <\/span><a href = \"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/125425-matlab-support-package-for-quantum-computing\"><span>via its entry on File Exchange<\/span><\/a><span>. Quantum computing has been available in MATLAB for a while now -- since R2023a but it recently got a few additional updates so now is a good time to dive in. <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>MATLAB currently supports a flavour of quantum computing called <\/span><a href = \"https:\/\/en.wikipedia.org\/wiki\/Quantum_logic_gate\"><span>gate-based quantum computing<\/span><\/a><span> at the root of which is a so-called quantum circuit.  Let's create and visualise one<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >gates = [hGate(1);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >         cxGate(1,2);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >         cxGate(1,3)];<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >C = quantumCircuit(gates);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >plot(C)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" uid=\"B9214900\" prevent-scroll=\"true\" data-testid=\"output_0\" tabindex=\"-1\" style=\"width: 1145px;\"><div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" src=\"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_2.png\" style=\"width: 560px; padding-bottom: 0px;\"><\/div><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" tabindex=\"-1\"><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This is a three-<\/span><a href = \"https:\/\/en.wikipedia.org\/wiki\/Qubit\"><span>qubit<\/span><\/a><span> circuit with three <\/span><a href = \"https:\/\/uk.mathworks.com\/help\/matlab\/math\/types-of-quantum-gates.html\"><span>quantum gates<\/span><\/a><span>.  Each horizonal line in the plot represents one of the qubits and the gates are arranged from left to right in the order that they are applied. The first qubit has a <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/ref\/hgate.html\"><span>Hadamard gate<\/span><\/a><span> applied to it while <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/ref\/cxgate.html\"><span>CNOT gates<\/span><\/a><span> have been applied to the second and third qubits, using the first qubit as the control.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In order to actually run this quantum circuit, you'd need access to a real quantum computer and these are not the sort of thing that one has on their desk! <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>For now, let's <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/ref\/quantumcircuit.simulate.html\"><span>simulate<\/span><\/a><span> this circuit, specifying that each qubit has an inital state of <\/span><span mathmlencoding=\"&lt;math xmlns=&quot;http:\/\/www.w3.org\/1998\/Math\/MathML&quot; display=&quot;inline&quot;&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;|&lt;\/mo&gt;&lt;mn&gt;0&lt;\/mn&gt;&lt;mo stretchy=&quot;false&quot;&gt;\u27e9&lt;\/mo&gt;&lt;\/mrow&gt;&lt;\/math&gt;\" style=\"vertical-align:-5px\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"inline\"><mrow><mo stretchy=\"false\">|<\/mo><mn>0<\/mn><mo stretchy=\"false\">\u27e9<\/mo><\/mrow><\/math><\/span><span> (never seen this notation before?  It's an example of <\/span><a href = \"https:\/\/en.wikipedia.org\/wiki\/Bra%E2%80%93ket_notation\"><span>bra-ket notation<\/span><\/a><span>) .  We'll discuss how to run it on a real quantum computer later.<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >S = simulate(C,<\/span><span style=\"color: #a709f5;\">\"000\"<\/span><span >)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement\" uid=\"D056A5C9\" prevent-scroll=\"true\" data-testid=\"output_1\" tabindex=\"-1\" style=\"width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"textElement eoOutputContent\" tabindex=\"-1\" data-previous-available-width=\"1108\" data-previous-scroll-height=\"94\" data-hashorizontaloverflow=\"false\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><span class=\"variableNameElement\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">S = <\/span><\/div><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">  QuantumState with properties:\r\n\r\n    BasisStates: [8\u00d71 string]\r\n     Amplitudes: [8\u00d71 double]\r\n      NumQubits: 3\r\n<\/div><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Let's express the simulated quantum state as a <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/ref\/quantum.gate.quantumstate.formula.html\"><span>formula<\/span><\/a><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >f = formula(S)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement\" uid=\"2EA26E8F\" prevent-scroll=\"true\" data-testid=\"output_2\" tabindex=\"-1\" style=\"width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"textElement eoOutputContent\" tabindex=\"-1\" data-previous-available-width=\"1108\" data-previous-scroll-height=\"49\" data-hashorizontaloverflow=\"false\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><span class=\"variableNameElement\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">f = <\/span><\/div><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">    \"0.70711 * |000&gt; +\r\n     0.70711 * |111&gt;\"\r\n<\/div><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>There are two possible quantum states in this system but if you were were to actually observe it, you'd only see one.  Which one you'd see is a matter of chance which is one of the consequences of quantum mechanics.  Let's ask MATLAB for the possible states and the probabilities of seeing each one.<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >[states,P] = querystates(S)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsTextMatrixElement embeddedOutputsVariableMatrixElement\" uid=\"539913F5\" prevent-scroll=\"true\" data-testid=\"output_3\" data-width=\"1115\" tabindex=\"-1\" style=\"width: 1145px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"matrixElement veSpecifier saveLoad eoOutputContent\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"veVariableName variableNameElement\" style=\"width: 1115px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"headerElementClickToInteract\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><span style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">states = <\/span><span class=\"veVariableValueSummary headerElement\" style=\"white-space: normal; font-style: italic; color: rgb(97, 97, 97); font-size: 12px;\">2\u00d71 string<\/span><\/div><\/div><div class=\"valueContainer\" data-layout=\"{&quot;totalRows&quot;:&quot;2&quot;,&quot;totalColumns&quot;:&quot;1&quot;}\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"variableValue\" style=\"width: 82px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">\"000\"       <br>\"111\"       <br><\/div><div class=\"horizontalEllipsis hide\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><div class=\"verticalEllipsis hide\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><\/div><\/div><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" tabindex=\"-1\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><\/div><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableMatrixElement\" uid=\"B882BDAD\" prevent-scroll=\"true\" data-testid=\"output_4\" data-width=\"1115\" tabindex=\"-1\" style=\"width: 1145px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"matrixElement veSpecifier saveLoad eoOutputContent\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"veVariableName variableNameElement double\" style=\"width: 1115px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"headerElementClickToInteract\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><span style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">P = <\/span><span class=\"veVariableValueSummary veMetaSummary\" style=\"white-space: normal; font-style: italic; color: rgb(97, 97, 97); font-size: 12px;\">2\u00d71<\/span><\/div><\/div><div class=\"valueContainer\" data-layout=\"{&quot;columnWidth&quot;:73,&quot;totalColumns&quot;:&quot;1&quot;,&quot;totalRows&quot;:&quot;2&quot;,&quot;charsPerColumn&quot;:10}\" style=\"white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"variableValue\" style=\"width: 75px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">    0.5000\r\n    0.5000\r\n<\/div><div class=\"horizontalEllipsis hide\" style=\"white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><div class=\"verticalEllipsis hide\" style=\"white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><\/div><\/div><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" tabindex=\"-1\" style=\"white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Each state has a 50% change of being measured.  We can plot this as a histogram but it's not a particularly interesting one<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >histogram(S)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" uid=\"93DC98BA\" prevent-scroll=\"true\" data-testid=\"output_5\" tabindex=\"-1\" style=\"width: 1145px;\"><div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" src=\"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_3.png\" style=\"width: 560px; padding-bottom: 0px;\"><\/div><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" tabindex=\"-1\"><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If you actually had that quantum system, you'd not be able to directly measure probabilities.  What you'd measure are the states and you'd do it a bunch of times to get an approximation of the probabilities.  How do you do that in MATLAB?<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span style=\"color: #008013;\">% Simulate 50 quantum measurements of the circuit<\/span><\/span><\/div><\/div><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >M = randsample(S,100)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement\" uid=\"57784AC7\" prevent-scroll=\"true\" data-testid=\"output_6\" tabindex=\"-1\" style=\"width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"textElement eoOutputContent\" tabindex=\"-1\" data-previous-available-width=\"1108\" data-previous-scroll-height=\"94\" data-hashorizontaloverflow=\"false\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><span class=\"variableNameElement\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">M = <\/span><\/div><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">  QuantumMeasurement with properties:\r\n\r\n    MeasuredStates: [2\u00d71 string]\r\n            Counts: [2\u00d71 double]\r\n         NumQubits: 3\r\n<\/div><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Put the result into a table<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >simT = table(M.Counts,M.MeasuredStates,VariableNames=[<\/span><span style=\"color: #a709f5;\">\"Counts\"<\/span><span >,<\/span><span style=\"color: #a709f5;\">\"States\"<\/span><span >])<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableTableElement\" uid=\"7A727A31\" prevent-scroll=\"true\" data-testid=\"output_7\" tabindex=\"-1\" style=\"width: calc(100% - 5px);\"><div class=\"ClientDocument veSpecifier table DataFitToViewport\" id=\"variableeditor_client_Document_0\" widgetid=\"variableeditor_client_Document_0\" tabindex=\"0\" aria-labelledby=\"variableeditor_views_SummaryBar_0\"><div class=\"summaryBar\" style=\"font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;\"><span>simT = <\/span><span style=\"color: rgb(179, 179, 179); font-style: normal;\">2\u00d72 table <\/span><\/div><div id=\"variableeditor_TableViewModel_0\" widgetid=\"variableeditor_TableViewModel_0\" class=\"table ClientViewDiv hasSummaryBar\" data-viewid=\"__1\" style=\"width: 100%; overflow: auto;\"><table cellspacing=\"0\" style=\"border-spacing: 0px; border-collapse: collapse;\"><thead><tr><th rowspan=\"1\" style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border: 1px solid rgb(191, 191, 191); text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>&nbsp;<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 86px; min-width: 86px; max-width: 86px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>Counts<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 86px; min-width: 86px; max-width: 86px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>States<\/span><\/th><\/tr><\/thead><tbody><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>1<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>51<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"000\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>2<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>49<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"111\"<\/span><\/td><\/tr><\/tbody><\/table><\/div><\/div><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" tabindex=\"-1\"><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This is roughly what you'd expect if the probability of getting each state is 50%.  Anyone expecting exactly 50 Counts for each state should retake probability-101! <\/span><\/div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Qubits? Gates? Quantum probabilities? What's going on?<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_4.png\" width = \"182\" height = \"177\" alt = \"824rqv.jpg\" style = \"vertical-align: baseline; width: 182px; height: 177px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I've shown you how to create and simulate a quantum circuit in MATLAB but, at this point, you may be wondering what on earth is going on?  How does any of this relate to implementing numerical algorithms?  This talk of qubits, gates and state probabilities is rather far removed from the variables, if-statements and for-loops that I used when I first studied how to solve problems.  As Alice famously said \"Toto, I\u2019ve a feeling we\u2019re not in Kansas anymore\"<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Quantum computing is a totally different way of approaching computation that requires rather more explanation than I could fit into a blog post.  We've got you covered, however.  If you are totally new to the field of quantum computing, just start with this article in the MATLAB documentation: <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/math\/introduction-to-quantum-computing.html\"><span>Introduction to Quantum Computing<\/span><\/a>. You may also find this MathWorks <\/span><a href = \"https:\/\/www.mathworks.com\/content\/dam\/mathworks\/handout\/quantum-computing-cheat-sheet.pdf\"><span>quantum computing cheat sheet<\/span><\/a> useful.<\/div>\r\n<div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Another article that you may find interesting is this in-depth one from fellow MathWorks blogger Sofia Ma: <\/span><a href = \"https:\/\/blogs.mathworks.com\/finance\/2023\/07\/24\/quantum-computing-for-optimizing-investment-portfolios\/\"><span>Quantum Computing for Optimizing Investment Portfolios<\/span><\/a><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>An insight that really helped me make my first baby steps into quantum computing is to understand that the states of quantum systems can be represented by vectors while all of the gates have matrix representations.  Here are two of them.  For more, see <\/span><a href = \"https:\/\/uk.mathworks.com\/help\/matlab\/math\/types-of-quantum-gates.html\"><span>Types of Quantum Gates<\/span><\/a><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_5.png\" width = \"897\" height = \"205\" alt = \"\" style = \"vertical-align: baseline; width: 897px; height: 205px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>or in other words....<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_6.png\" width = \"211\" height = \"281\" alt = \"824r3r.jpg\" style = \"vertical-align: baseline; width: 211px; height: 281px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If you have any other favourite sources for learning about quantum computing, let me know in the comments section. <\/span><\/div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Applications of quantum computing<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Maybe you don't care so much about how to design a quantum algorithm and want to jump straight to potential applications.  MathWorks has you covered here as well with a range of algorithms fully implemented in the new framework and available in the documentation.  These include<\/span><\/div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/math\/introduction-to-quantum-computing.html\"><span>Graph Coloring with Grover's Algorithm<\/span><\/a><\/li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/math\/ground-state-protein-folding-using-variational-quantum-eigensolver-vqe.html\"><span>Ground-State Protein Folding Using Variational Quantum Eigensolver (VQE)<\/span><\/a><\/li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/math\/quantum-monte-carlo-simulation.html\"><span>Quantum Monte Carlo (QMC) simulation<\/span><\/a><\/li><\/ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>We also have a <\/span><span style=' font-weight: bold;'>set of open-source examples of quantum computing<\/span><span> algorithms <\/span><a href = \"https:\/\/github.com\/mathworks\/Quantum-Computing-MATLAB\"><span>over on GitHub<\/span><\/a><span> covering topics such as Portfolio Optimisation and Machine Learning classifiers.  Pull Requests are welcome!<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = \"https:\/\/github.com\/mathworks\/Quantum-Computing-MATLAB\"><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_7.png\" width = \"408\" height = \"312\" alt = \"\" style = \"vertical-align: baseline; width: 408px; height: 312px;\"><\/img><\/a><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>We've also implemented something called <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/qubo.html\"><span>QUBO --  Quadratic Unconstrained Binary Optimization<\/span><\/a><span> which can be used to solve combinatorical optimization problems such as the <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/math\/quantum-tsp.html\"><span>Traveling Salesperson Problem<\/span><\/a><span> and the <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/math\/quantum-capacitated-vehicle-routing.html\"><span>Capacitated Vehicle Routing Problem<\/span><\/a><span> among others. <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Quantum computing has the potential to revolutionise how we solve many problems that are difficult using conventional computers.  That is, problems that would take a conventional supercomputer years to solve could be solved very quickly using a quantum algorithm on a suitable quantum computer. This is why there is so much hype around the subject and why there are so many quantum computing booths at supercomputing conferences. <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Unfortunately, the quantum computers that currently exist are not yet powerful enough to do this and thus, revolutionise computing.  <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Quantum computers <\/span><span style=' font-weight: bold;'>do<\/span><span> exist, however, and they are good enough for us to test that our simulated algorithms do actually work on real quantum hardware...even if they are not yet quite good enough to give your local supercomputer a run for its money.<\/span><\/div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Running MATLAB quantum algorithms on real quantum computers using Amazon AWS<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Real quantum computers are rather difficult to buy and it's unlikely that you have one sitting on your desk.  An organisation who can give you access to some, however, is Amazon AWS and they make them available to the world via the <\/span><a href = \"https:\/\/aws.amazon.com\/braket\/\"><span>Amazon Braket service<\/span><\/a><span>.  Details on how to connect MATLAB with the Amazon Braket service are at <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/math\/run-quantum-circuit-on-hardware.html\"><span>Run Quantum Circuit on Hardware Using AWS - MATLAB &amp; Simulink (mathworks.com)<\/span><\/a><span> <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Before running this code, I had to create an S3 bucket with a name that started with the string \"<\/span><span style=' font-family: monospace;'>amazon-braket-\"<\/span><span>. You'll need to create your own unique bucket name in your AWS account.  Details on how to create S3 buckets in MATLAB can be found at <\/span><a href = \"https:\/\/www.mathworks.com\/help\/cloudcenter\/ug\/transfer-data-to-amazon-s3-buckets.html\"><span>Transfer Data to Amazon S3 Buckets and Access Data Using MATLAB Datastore - MATLAB &amp; Simulink (mathworks.com)<\/span><\/a><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>There are two types of quantum resource available on Amazon that are of interest to us<\/span><\/div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span style=' font-weight: bold;'>QPU Devices:<\/span><span> <\/span><span>These devices are quantum computers used to perform probabilistic measurements of circuits. Not all QPU devices are supported. To find out if a device is supported, try connecting to the device using<\/span><span> <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/ref\/quantum.backend.quantumdeviceaws-class.html\"><span style=' font-family: monospace;'>quantum.backend.QuantumDeviceAWS<\/span><\/a><span>. Availability and number of qubits supported can also vary, so check the device details before sending circuits for measurement.<\/span><\/li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span style=' font-weight: bold;'>Simulator Devices:<\/span><span> <\/span><span>Because memory usage scales exponentially with the number of qubits, larger circuits with many qubits might stretch the limits of memory available on your local computer. To address that issue, AWS also provides cloud-scale simulators. The functionality is similar to using<\/span><span> <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/ref\/quantum.gate.quantumstate.randsample.html\"><span style=' font-family: monospace;'>randsample<\/span><\/a><span> <\/span><span>on your local system, but the simulators can support up to 34 qubits with cloud-scale performance.<\/span><\/li><\/ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>At the time of writing, the example in MathWorks documentation connects to a simulator: <\/span><span style=' font-family: monospace;'>\"SV1\"<\/span><span>, a state-vector simulator used for prototyping circuits. <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I want to run on the real-deal though!  I can't say I've done quantum computing until I've submitted a job to a real quatum computer.  I took a look at the available devices on Amazon Braket and randomly chose the Rigetti Aspen-M-3.  This is a 79 Qubit device and the details section over at Amazon told me that <\/span><span style=' font-weight: bold; font-style: italic;'>\"Rigetti quantum processors are universal, gate-model machines based on tunable superconducting qubits.\"  <\/span><span style=' font-style: italic;'>Sounds cool! <\/span><span>Superconductors and programmable quantum computers!  If only 1996 physics undergraduate Mike Croucher could see me now \ud83d\ude42<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span style=\"color: #008013;\">% This code will not work for you unless you have configured AWS correctly<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >reg = <\/span><span style=\"color: #a709f5;\">\"us-west-1\"<\/span><span >;<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >bucketPath = <\/span><span style=\"color: #a709f5;\">\"s3:\/\/amazon-braket-walkingrandomlyblog\/default\"<\/span><span >;  <\/span><span style=\"color: #008013;\">% You'll need to change this name to your own bucket<\/span><\/span><\/div><\/div><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >device = quantum.backend.QuantumDeviceAWS(<\/span><span style=\"color: #a709f5;\">\"Aspen-M-3\"<\/span><span >,Region=reg,S3Path=bucketPath)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement\" uid=\"A8C62ABC\" prevent-scroll=\"true\" data-testid=\"output_8\" tabindex=\"-1\" style=\"width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"textElement eoOutputContent\" tabindex=\"-1\" data-previous-available-width=\"1108\" data-previous-scroll-height=\"108\" data-hashorizontaloverflow=\"false\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><span class=\"variableNameElement\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">device = <\/span><\/div><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">  QuantumDeviceAWS with properties:\r\n\r\n         Name: \"Aspen-M-3\"\r\n    DeviceARN: \"arn:aws:braket:us-west-1::device\/qpu\/rigetti\/Aspen-M-3\"\r\n       Region: \"us-west-1\"\r\n       S3Path: \"s3:\/\/amazon-braket-walkingrandomlyblog\/default\"\r\n<\/div><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/ref\/quantum.backend.quantumtaskaws.fetchdetails.html\"><span style=' font-family: monospace;'>fetchDetails<\/span><\/a><span style=' font-family: monospace;'> <\/span><span>command can be used to....um...fetch the details of the quantum device I want to submit jobs to. <\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >fetchDetails(device)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement scrollableOutput\" uid=\"F20D0B4E\" prevent-scroll=\"true\" data-testid=\"output_9\" tabindex=\"-1\" style=\"width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"textElement eoOutputContent scrollArea\" tabindex=\"-1\" data-previous-available-width=\"1108\" data-previous-scroll-height=\"108\" data-hashorizontaloverflow=\"true\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><span class=\"variableNameElement\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">ans = <span class=\"headerElement\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">struct with fields:<\/span><\/span><\/div><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">             deviceArn: \"arn:aws:braket:us-west-1::device\/qpu\/rigetti\/Aspen-M-3\"\r\n    deviceCapabilities: \"{\"service\": {\"braketSchemaHeader\": {\"name\": \"braket.device_schema.device_service_properties\", \"version\": \"1\"}, \"executionWindows\": [{\"executionDay\": \"Everyday\", \"windowStartHour\": \"04:00:00\", \"windowEndHour\": \"06:00:00\"}, {\"executionDay\": \"Everyday\", \"windowStartHour\": \"15:00:00\", \"windowEndHour\": \"18:00:00\"}], \"shotsRange\": [10, 100000], \"deviceCost\": {\"price\": 0.00035, \"unit\": \"shot\"}, \"deviceDocumentation\": {\"imageUrl\": \"http:\/\/d1.awsstatic.com\/logos\/Rigetti_logo_rgb_teal.0cbe3c0653e755ab97c04ec56f3611f53e2a780c.png\", \"summary\": \"Universal gate-model QPU based on superconducting qubits\", \"externalDocumentationUrl\": \"https:\/\/qcs.rigetti.com\/qpus\/\"}, \"deviceLocation\": \"California, USA\", \"updatedAt\": \"2023-09-15T15:50:33+00:00\", \"getTaskPollIntervalMillis\": 200}, \"action\": {\"braket.ir.jaqcd.program\": {\"version\": [\"1.0\", \"1.1\"], \"actionType\": \"braket.ir.jaqcd.program\", \"supportedOperations\": [\"cz\", \"xy\", \"ccnot\", \"cnot\", \"cphaseshift\", \"cphaseshift00\", \"cphaseshift01\", \"cphaseshift10\", \"cswap\", \"h\", \"i\", \"iswap\", \"phaseshift\", \"pswap\", \"rx\", \"ry\", \"rz\", \"s\", \"si\", \"swap\", \"t\", \"ti\", \"x\", \"y\", \"z\", \"start_verbatim_box\", \"end_verbatim_box\"], \"supportedResultTypes\": [{\"name\": \"Sample\", \"observables\": [\"x\", \"y\", \"z\", \"h\", \"i\"], \"minShots\": 10, \"maxShots\": 100000}, {\"name\": \"Expectation\", \"observables\": [\"x\", \"y\", \"z\", \"h\", \"i\"], \"minShots\": 10, \"maxShots\": 100000}, {\"name\": \"Variance\", \"observables\": [\"x\", \"y\", \"z\", \"h\", \"i\"], \"minShots\": 10, \"maxShots\": 100000}, {\"name\": \"Probability\", \"minShots\": 10, \"maxShots\": 100000}], \"disabledQubitRewiringSupported\": true}, \"braket.ir.openqasm.program\": {\"version\": [\"1.0\"], \"actionType\": \"braket.ir.openqasm.program\", \"supportedOperations\": [\"cz\", \"xy\", \"ccnot\", \"cnot\", \"cphaseshift\", \"cphaseshift00\", \"cphaseshift01\", \"cphaseshift10\", \"cswap\", \"h\", \"i\", \"iswap\", \"phaseshift\", \"pswap\", \"rx\", \"ry\", \"rz\", \"s\", \"si\", \"swap\", \"t\", \"ti\", \"x\", \"y\", \"z\"], \"supportedModifiers\": [], \"supportedPragmas\": [\"verbatim\", \"braket_result_type_sample\", \"braket_result_type_expectation\", \"braket_result_type_variance\", \"braket_result_type_probability\"], \"forbiddenPragmas\": [\"braket_unitary_matrix\", \"braket_result_type_state_vector\", \"braket_result_type_density_matrix\", \"braket_result_type_amplitude\", \"braket_result_type_adjoint_gradient\"], \"maximumQubitArrays\": 1, \"maximumClassicalArrays\": 1, \"forbiddenArrayOperations\": [\"concatenation\", \"negativeIndex\", \"range\", \"rangeWithStep\", \"slicing\", \"selection\"], \"requiresAllQubitsMeasurement\": false, \"supportPhysicalQubits\": true, \"requiresContiguousQubitIndices\": false, \"supportsPartialVerbatimBox\": true, \"supportsUnassignedMeasurements\": false, \"disabledQubitRewiringSupported\": false, \"supportedResultTypes\": [{\"name\": \"Sample\", \"observables\": [\"x\", \"y\", \"z\", \"h\", \"i\"], \"minShots\": 10, \"maxShots\": 100000}, {\"name\": \"Expectation\", \"observables\": [\"x\", \"y\", \"z\", \"h\", \"i\"], \"minShots\": 10, \"maxShots\": 100000}, {\"name\": \"Variance\", \"observables\": [\"x\", \"y\", \"z\", \"h\", \"i\"], \"minShots\": 10, \"maxShots\": 100000}, {\"name\": \"Probability\", \"minShots\": 10, \"maxShots\": 100000}]}}, \"deviceParameters\": {\"title\": \"RigettiDeviceParameters\", \"description\": \"This defines the parameters common to all the Rigetti devices.\\n\\nAttributes:\\n    paradigmParameters: Parameters that are common to gatemodel paradigm\\n\\nExamples:\\n    &gt;&gt;&gt; import json\\n    &gt;&gt;&gt; input_json = {\\n    ...    \\\"braketSchemaHeader\\\": {\\n    ...        \\\"name\\\": \\\"braket.device_schema.rigetti.rigetti_device_parameters\\\",\\n    ...        \\\"version\\\": \\\"1\\\",\\n    ...    },\\n    ...    \\\"paradigmParameters\\\": {\\\"braketSchemaHeader\\\": {\\n    ...        \\\"name\\\": \\\"braket.device_schema.gate_model_parameters\\\",\\n    ...        \\\"version\\\": \\\"1\\\",\\n    ...    },\\\"qubitCount\\\": 1},\\n    ... }\\n    &gt;&gt;&gt; RigettiDeviceParameters.parse_raw_schema(json.dumps(input_json))\", \"type\": \"object\", \"properties\": {\"braketSchemaHeader\": {\"title\": \"Braketschemaheader\", \"const\": {\"name\": \"braket.device_schema.rigetti.rigetti_device_parameters\", \"version\": \"1\"}}, \"paradigmParameters\": {\"$ref\": \"#\/definitions\/GateModelParameters\"}}, \"required\": [\"paradigmParameters\"], \"definitions\": {\"GateModelParameters\": {\"title\": \"GateModelParameters\", \"description\": \"Defines parameters common to all gate model devices.\\n\\nAttributes:\\n    qubitCount: Number of qubits used by the circuit.\\n    disableQubitRewiring: Whether to run the circuit with the exact qubits chosen,\\n        without any rewiring downstream.\\n        If ``True``, no qubit rewiring is allowed; if ``False``, qubit rewiring is allowed.\\n\\nExamples:\\n    &gt;&gt;&gt; import json\\n    &gt;&gt;&gt; input_json = {\\n    ...    \\\"braketSchemaHeader\\\": {\\n    ...        \\\"name\\\": \\\"braket.device_schema.gate_model_parameters\\\",\\n    ...        \\\"version\\\": \\\"1\\\",\\n    ...    },\\n    ...    \\\"qubitCount\\\": 1,\\n    ...    \\\"disableQubitRewiring\\\": True\\n    ... }\\n    &gt;&gt;&gt; GateModelParameters.parse_raw_schema(json.dumps(input_json))\", \"type\": \"object\", \"properties\": {\"braketSchemaHeader\": {\"title\": \"Braketschemaheader\", \"const\": {\"name\": \"braket.device_schema.gate_model_parameters\", \"version\": \"1\"}}, \"qubitCount\": {\"title\": \"Qubitcount\", \"minimum\": 0, \"type\": \"integer\"}, \"disableQubitRewiring\": {\"title\": \"Disablequbitrewiring\", \"default\": false, \"type\": \"boolean\"}}, \"required\": [\"qubitCount\"]}}}, \"braketSchemaHeader\": {\"name\": \"braket.device_schema.rigetti.rigetti_device_capabilities\", \"version\": \"1\"}, \"paradigm\": {\"braketSchemaHeader\": {\"name\": \"braket.device_schema.gate_model_qpu_paradigm_properties\", \"version\": \"1\"}, \"connectivity\": {\"fullyConnected\": false, \"connectivityGraph\": {\"0\": [\"1\", \"7\", \"103\"], \"100\": [\"101\", \"107\"], \"10\": [\"11\", \"17\", \"113\"], \"110\": [\"111\", \"117\"], \"20\": [\"21\", \"27\", \"123\"], \"120\": [\"121\", \"127\"], \"30\": [\"31\", \"37\", \"133\"], \"130\": [\"131\", \"137\"], \"40\": [\"41\", \"47\", \"143\"], \"140\": [\"141\", \"147\"], \"1\": [\"0\", \"2\", \"16\"], \"101\": [\"100\", \"102\"], \"11\": [\"10\", \"12\"], \"111\": [\"110\", \"112\", \"126\"], \"21\": [\"20\", \"22\", \"36\"], \"121\": [\"120\", \"122\"], \"31\": [\"30\", \"32\", \"46\"], \"131\": [\"130\", \"132\", \"146\"], \"41\": [\"40\", \"42\"], \"141\": [\"140\", \"142\"], \"2\": [\"1\", \"3\", \"15\"], \"102\": [\"101\", \"103\", \"115\"], \"12\": [\"11\", \"13\", \"25\"], \"112\": [\"111\", \"113\", \"125\"], \"22\": [\"21\", \"23\", \"35\"], \"122\": [\"121\", \"123\", \"135\"], \"32\": [\"31\", \"33\", \"45\"], \"132\": [\"131\", \"133\", \"145\"], \"42\": [\"41\", \"43\"], \"142\": [\"141\", \"143\"], \"3\": [\"2\", \"4\"], \"103\": [\"102\", \"104\", \"0\"], \"13\": [\"12\", \"14\"], \"113\": [\"112\", \"114\", \"10\"], \"23\": [\"22\", \"24\"], \"123\": [\"122\", \"124\", \"20\"], \"33\": [\"32\", \"34\"], \"133\": [\"132\", \"134\", \"30\"], \"43\": [\"42\", \"44\"], \"143\": [\"142\", \"144\", \"40\"], \"4\": [\"3\", \"5\"], \"104\": [\"103\", \"105\", \"7\"], \"14\": [\"13\", \"15\"], \"114\": [\"113\", \"115\", \"17\"], \"24\": [\"23\", \"25\"], \"124\": [\"123\", \"125\", \"27\"], \"34\": [\"33\", \"35\"], \"134\": [\"133\", \"135\", \"37\"], \"44\": [\"43\", \"45\"], \"144\": [\"143\", \"145\", \"47\"], \"5\": [\"4\", \"6\"], \"105\": [\"104\", \"106\"], \"15\": [\"14\", \"16\", \"2\"], \"115\": [\"114\", \"102\"], \"25\": [\"24\", \"26\", \"12\"], \"125\": [\"124\", \"126\", \"112\"], \"35\": [\"34\", \"36\", \"22\"], \"135\": [\"134\", \"122\"], \"45\": [\"44\", \"46\", \"32\"], \"145\": [\"144\", \"146\", \"132\"], \"6\": [\"5\"], \"106\": [\"105\", \"107\"], \"16\": [\"15\", \"17\", \"1\"], \"116\": [\"117\"], \"26\": [\"25\", \"27\"], \"126\": [\"125\", \"127\", \"111\"], \"36\": [\"35\", \"37\", \"21\"], \"46\": [\"45\", \"47\", \"31\"], \"146\": [\"145\", \"147\", \"131\"], \"7\": [\"0\", \"104\"], \"107\": [\"106\", \"100\"], \"17\": [\"16\", \"10\", \"114\"], \"117\": [\"116\", \"110\"], \"27\": [\"26\", \"20\", \"124\"], \"127\": [\"126\", \"120\"], \"37\": [\"36\", \"30\", \"134\"], \"137\": [\"130\"], \"47\": [\"46\", \"40\", \"144\"], \"147\": [\"146\", \"140\"]}}, \"qubitCount\": 79, \"nativeGateSet\": [\"rx\", \"rz\", \"cz\", \"cphaseshift\", \"xy\"]}, \"provider\": {\"braketSchemaHeader\": {\"name\": \"braket.device_schema.rigetti.rigetti_provider_properties\", \"version\": \"1\"}, \"specs\": {\"1Q\": {\"0\": {\"fActiveReset\": 0.966, \"fRO\": 0.946, \"f1QRB\": 0.9972872933599024, \"f1QRB_std_err\": 7.838351195153969e-05, \"f1Q_simultaneous_RB\": 0.9953169329383368, \"f1Q_simultaneous_RB_std_err\": 0.00024182103479684447, \"T1\": 1.0019627401991471e-05, \"T2\": 1.8156447816365015e-05}, \"100\": {\"fActiveReset\": 0.9985, \"fRO\": 0.972, \"f1QRB\": 0.998954207277828, \"f1QRB_std_err\": 0.00014837187531456048, \"f1Q_simultaneous_RB\": 0.9971558102223412, \"f1Q_simultaneous_RB_std_err\": 0.00015862791239059965, \"T1\": 1.1816795696395488e-05, \"T2\": 2.0095701209033546e-05}, \"10\": {\"fActiveReset\": 0.954, \"fRO\": 0.981, \"f1QRB\": 0.9992031567592476, \"f1QRB_std_err\": 0.00014056593724064313, \"f1Q_simultaneous_RB\": 0.9976156360254491, \"f1Q_simultaneous_RB_std_err\": 8.608369330764301e-05, \"T1\": 2.5578694019978698e-05, \"T2\": 1.9006026304791726e-05}, \"110\": {\"fActiveReset\": 0.956, \"fRO\": 0.982, \"f1QRB\": 0.9964323820015337, \"f1QRB_std_err\": 0.0002538166941835989, \"f1Q_simultaneous_RB\": 0.9944725505869456, \"f1Q_simultaneous_RB_std_err\": 0.00046613884655654996, \"T1\": 2.1541132994906675e-05, \"T2\": 2.4168521929465816e-05}, \"20\": {\"fActiveReset\": 0.9925, \"fRO\": 0.973, \"f1QRB\": 0.9987680979711324, \"f1QRB_std_err\": 0.00024454249633089407, \"f1Q_simultaneous_RB\": 0.9967164854629315, \"f1Q_simultaneous_RB_std_err\": 0.00034938876334807785, \"T1\": 1.916757238906719e-05, \"T2\": 2.0065645767958196e-05}, \"120\": {\"fActiveReset\": 0.998, \"fRO\": 0.977, \"f1QRB\": 0.9983062074153319, \"f1QRB_std_err\": 5.774983328102287e-05, \"f1Q_simultaneous_RB\": 0.9970528341245045, \"f1Q_simultaneous_RB_std_err\": 0.00014167831836001615, \"T1\": 1.2764039701629315e-05, \"T2\": 2.0246986797656767e-05}, \"30\": {\"fActiveReset\": 0.944, \"fRO\": 0.859, \"f1QRB\": 0.9983567784701302, \"f1QRB_std_err\": 0.0001484753223172316, \"f1Q_simultaneous_RB\": 0.9962760717321852, \"f1Q_simultaneous_RB_std_err\": 0.00012898655899217618, \"T1\": 3.72516437563419e-06, \"T2\": 3.60229201220574e-06}, \"130\": {\"fActiveReset\": 0.996, \"fRO\": 0.931, \"f1QRB\": 0.9953353543402388, \"f1QRB_std_err\": 0.0002495782404244499, \"f1Q_simultaneous_RB\": 0.9923808464253132, \"f1Q_simultaneous_RB_std_err\": 0.0003757619231654068, \"T1\": 2.1055966682670402e-05, \"T2\": 8.279538699664696e-06}, \"40\": {\"fActiveReset\": 0.9990000000000001, \"fRO\": 0.977, \"f1QRB\": 0.998754212487603, \"f1QRB\u2026\"\r\n            deviceName: \"Aspen-M-3\"\r\n          deviceStatus: \"ONLINE\"\r\n            deviceType: \"QPU\"\r\n          providerName: \"Rigetti\"\r\n<\/div><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I'm connected and I'm ready to go.  Remember that circuit that I created at the beginning of the blog post?<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >plot(C)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" uid=\"C0ADF89E\" prevent-scroll=\"true\" data-testid=\"output_10\" tabindex=\"-1\" style=\"width: 1145px;\"><div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" src=\"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_2.png\" style=\"width: 560px; padding-bottom: 0px;\"><\/div><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" tabindex=\"-1\"><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I've simulated it on my desktop.  Time to run it on the real thing in the cloud using the <\/span><a href = \"https:\/\/www.mathworks.com\/help\/matlab\/ref\/quantumcircuit.run.html\"><span style=' font-family: monospace;'>run<\/span><\/a><span> command<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >task = run(C,device)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement\" uid=\"E3A61459\" prevent-scroll=\"true\" data-testid=\"output_11\" tabindex=\"-1\" style=\"width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"textElement eoOutputContent\" tabindex=\"-1\" data-previous-available-width=\"1108\" data-previous-scroll-height=\"79\" data-hashorizontaloverflow=\"false\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><span class=\"variableNameElement\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">task = <\/span><\/div><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">  QuantumTaskAWS with properties:\r\n\r\n     Status: \"queued\"\r\n    TaskARN: \"arn:aws:braket:us-west-1:580681155480:quantum-task\/c9531ea3-3de8-4ee8-ad02-cefce2f8bc99\"\r\n<\/div><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I'm in the quantum queue in the cloud!  Let's get MATLAB to wait until the task is finished. The following command blocks execution until the task on the quantum device has finished running.<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >wait(task)<\/span><\/span><\/div><\/div><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Eventually, the task will complete and I can get the results<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >R = fetchOutput(task)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement\" uid=\"16080593\" prevent-scroll=\"true\" data-testid=\"output_12\" tabindex=\"-1\" style=\"width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div class=\"textElement eoOutputContent\" tabindex=\"-1\" data-previous-available-width=\"1108\" data-previous-scroll-height=\"94\" data-hashorizontaloverflow=\"false\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\"><span class=\"variableNameElement\" style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">R = <\/span><\/div><div style=\"white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">  QuantumMeasurement with properties:\r\n\r\n    MeasuredStates: [8\u00d71 string]\r\n            Counts: [8\u00d71 double]\r\n         NumQubits: 3\r\n<\/div><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This feels very much like <\/span><a href = \"https:\/\/blogs.mathworks.com\/matlab\/2023\/05\/19\/direct-submission-to-hpc-clusters-from-matlab\/\"><span>MATLAB's remote access to traditional HPC clusters<\/span><\/a><span>! <\/span><\/div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Results from running on a real quantum computer<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>When I simulated this quantum circuit on my local machine 100 times, I got the following results<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >simT<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableTableElement\" uid=\"01CAFF93\" prevent-scroll=\"true\" data-testid=\"output_13\" tabindex=\"-1\" style=\"width: calc(100% - 5px);\"><div class=\"ClientDocument veSpecifier table DataFitToViewport\" id=\"variableeditor_client_Document_1\" widgetid=\"variableeditor_client_Document_1\" tabindex=\"0\" aria-labelledby=\"variableeditor_views_SummaryBar_1\"><div class=\"summaryBar\" style=\"font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;\"><span>simT = <\/span><span style=\"color: rgb(179, 179, 179); font-style: normal;\">2\u00d72 table <\/span><\/div><div id=\"variableeditor_TableViewModel_1\" widgetid=\"variableeditor_TableViewModel_1\" class=\"table ClientViewDiv hasSummaryBar\" data-viewid=\"__1\" style=\"width: 100%; overflow: auto;\"><table cellspacing=\"0\" style=\"border-spacing: 0px; border-collapse: collapse;\"><thead><tr><th rowspan=\"1\" style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border: 1px solid rgb(191, 191, 191); text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>&nbsp;<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 86px; min-width: 86px; max-width: 86px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>Counts<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 86px; min-width: 86px; max-width: 86px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>States<\/span><\/th><\/tr><\/thead><tbody><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>1<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>51<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"000\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>2<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>49<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"111\"<\/span><\/td><\/tr><\/tbody><\/table><\/div><\/div><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" tabindex=\"-1\"><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Running the circuit on a real system gave the following<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >T = table(R.Counts,R.MeasuredStates,VariableNames=[<\/span><span style=\"color: #a709f5;\">\"Counts\"<\/span><span >,<\/span><span style=\"color: #a709f5;\">\"States\"<\/span><span >])<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableTableElement\" uid=\"2E41057E\" prevent-scroll=\"true\" data-testid=\"output_14\" tabindex=\"-1\" style=\"width: calc(100% - 5px);\"><div class=\"ClientDocument veSpecifier table DataFitToViewport\" id=\"variableeditor_client_Document_2\" widgetid=\"variableeditor_client_Document_2\" tabindex=\"0\" aria-labelledby=\"variableeditor_views_SummaryBar_2\"><div class=\"summaryBar\" style=\"font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;\"><span>T = <\/span><span style=\"color: rgb(179, 179, 179); font-style: normal;\">8\u00d72 table <\/span><\/div><div id=\"variableeditor_TableViewModel_2\" widgetid=\"variableeditor_TableViewModel_2\" class=\"table ClientViewDiv hasSummaryBar\" data-viewid=\"__1\" style=\"width: 100%; overflow: auto;\"><table cellspacing=\"0\" style=\"border-spacing: 0px; border-collapse: collapse;\"><thead><tr><th rowspan=\"1\" style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border: 1px solid rgb(191, 191, 191); text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>&nbsp;<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 86px; min-width: 86px; max-width: 86px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>Counts<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 86px; min-width: 86px; max-width: 86px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>States<\/span><\/th><\/tr><\/thead><tbody><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>1<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>32<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"000\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>2<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>4<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"001\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>3<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>7<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"010\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>4<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>3<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"011\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>5<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>3<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"100\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>6<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>6<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"101\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>7<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>9<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"110\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>8<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;\"><span>36<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 86px; min-width: 86px; max-width: 86px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"111\"<\/span><\/td><\/tr><\/tbody><\/table><\/div><\/div><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" tabindex=\"-1\"><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The overall number of Counts sum to 100 because that's the default number of times the run command runs the circuit.  Each of these runs is called a shot.<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >histogram(R)<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" uid=\"A167A35E\" prevent-scroll=\"true\" data-testid=\"output_15\" tabindex=\"-1\" style=\"width: 1145px;\"><div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" src=\"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_9.png\" style=\"width: 560px; padding-bottom: 0px;\"><\/div><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" tabindex=\"-1\"><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>What's interesting here is that along with the two states I expected to observe, I've also observed every other possible state a small number of times.  I understand that this is due to noise in the system.  Real quantum computers are not perfect devices and this noise is part of the reality of working with quantum algorithms on real devices. <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>It's difficult to convey to you how exciting this feels!  I know that the computation I've done is essentially a pointless demo that I've lifted from the MATLAB documentation but there is just something thrilling about running code on a completely different type of computer to anything I've ever used before.  <\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The run you see above is the first (and so far only) time I have ever run anything on a real quantum computer!<\/span><\/div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Costs of the AWS quantum computation<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>As you might expect, running jobs on a quantum computer in the cloud costs money.  The way Quantum jobs are currently priced by AWS are a cost per task and an additional cost per shot.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In the context of this calculation, you can think of the task as setting up the circuit and each shot as the cost of running that circuit 1 time. At the time of writing, the device I used had a cost of 30 cents per task and 0.035 cents per shot so the 100 shot calculation cost me about &dollar;0.34.   There will also be S3 storage costs but for this computation I'm guessing it will be pretty negligible.  I doubt I'll be sufficiently motivated to fill in my expense claim to MathWorks for cloud costs associated with this blog post.<\/span><\/div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Version of the MATLAB Support Package for Quantum Computing used<\/span><\/h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I used version 23.2 of the MATLAB Support Package for Quantum Computing.  You can see which one you have installed by executing<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper\"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; '><span style=\"white-space: pre\"><span >matlabshared.supportpkg.getInstalled<\/span><\/span><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span><\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span><\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><\/div>\r\n<\/div><script type=\"text\/javascript\">var css = '\/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsErrorElement .diagnosticMessage-errorType {    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} \/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsWarningElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsWarningElement .diagnosticMessage-warningType {    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} \/* Copyright 2015-2023 The MathWorks, Inc. *\/\/* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip *\/.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    \/*This fallback value will be used for appdesigner warnings*\/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    \/*This fallback value will be used for appdesigner warnings*\/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: var(--mw-color-matlabWarning) !important;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    \/*This fallback value will be used in appdesigner error tooltip text*\/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    \/*This fallback value will be used in appdesigner error tooltip text*\/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: var(--mw-color-matlabErrors) !important;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 550px;} .embeddedOutputsTextElement .textElement,.embeddedOutputsVariableStringElement .textElement {    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 2px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .eoOutputWrapper .variableElement {    padding-top: 2px;} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-left: 9px;} .outputsOnRight .embeddedOutputsVariableElement.rightPaneElement .eoOutputContent {    \/* Remove extra space allocated for navigation border *\/    margin-top: 0;    margin-bottom: 0;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} \/* * Ellipses as base64 for HTML export. *\/.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    \/* base64 encoded version of images-liveeditor\/HEllipsis.png *\/    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url(\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4\/\/8\/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==\");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    \/* base64 encoded version of images-liveeditor\/VEllipsis.png *\/    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url(\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4\/\/8\/AzGYgWyFMECMwv8QddRS+P\/\/KyimlmcGUOFoOI6GI\/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==\");} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;} \/* ClientDocument has a summary bar child that takes up 17px, this clashes with overflow on the view which allots space for scrollbars. On print preview, this causes headers from <thead> to overlap on subsequent pages. Displaying Document as flex renders summarybar and view in column format and fixes the issue g2788485 *\/.embeddedOutputsVariableTableElement .ClientDocument {  display: flex;  flex-direction: column;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text\/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }<\/script>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/10\/quantum_6.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><p>Back in May of this year i attended the ISC High Performance Computing conference with a few other colleagues from MathWorks and was astonished at the number of booths related to various quantum... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/matlab\/2023\/10\/17\/quantum-computing-in-matlab-r2023b-on-the-desktop-and-in-the-cloud\/\">read more >><\/a><\/p>","protected":false},"author":176,"featured_media":1709,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[29,20,77],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/posts\/1724"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/users\/176"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/comments?post=1724"}],"version-history":[{"count":7,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/posts\/1724\/revisions"}],"predecessor-version":[{"id":1954,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/posts\/1724\/revisions\/1954"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/media\/1709"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/media?parent=1724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/categories?post=1724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/tags?post=1724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}