5210.js 1.4 KB

12
  1. "use strict";(self.webpackChunkmy_application=self.webpackChunkmy_application||[]).push([[5210],{5210:(n,t,e)=>{e.r(t),e.d(t,{default:()=>i});const i='// Run this cell using Ctrl+Enter (⌘+Enter on Mac)\n// Then run the next cell to see the output\n\nopen Microsoft.Quantum.Diagnostics;\n\noperation QubitsDemo () : Unit {\n // This line allocates a qubit in state |0⟩\n use q = Qubit();\n Message("State |0⟩:");\n\n // This line prints out the state of the quantum computer\n // Since only one qubit is allocated, only its state is printed\n DumpMachine();\n\n // This line changes the qubit from state |0⟩ to state |1⟩\n X(q);\n\n Message("State |1⟩:");\n DumpMachine();\n\n // This line changes the qubit to state |-⟩ = (1/sqrt(2))(|0⟩ - |1⟩)\n // That is, this puts the qubit into a superposition\n // 1/sqrt(2) is approximately 0.707107\n H(q);\n\n Message("State |-⟩:");\n DumpMachine();\n\n // This line changes the qubit to state |-i⟩ = (1/sqrt(2))(|0⟩ - i|1⟩)\n S(q);\n\n Message("State |-i⟩:");\n DumpMachine();\n\n // This will put the qubit into an uneven superposition,\n // where the amplitudes of |0⟩ and |1⟩ have different moduli\n Rx(2.0, q);\n Ry(1.0, q);\n\n Message("Uneven superposition state:");\n DumpMachine();\n\n // This line returns the qubit to state |0⟩\n Reset(q);\n}\n'}}]);
  2. //# sourceMappingURL=5210.js.map