rsnt_translations
56,437
edits
No edit summary |
(Created page with "Quantum Circuit Object: qubit_count: 2 q[1]:──H────*── ¦ q[2]:───────X── }} </noinclude> In the above code section, the Hadamard gate creates an equal superposition of |0⟩ and |1⟩ on the first qubit while the CNOT gate (controlled X gate) creates an entanglement between the two qubits. We find an equal superposition of states |00⟩ and |11⟩, which is the first Bell state. The <code>simulate</code> function allows...") |
||
Line 29: | Line 29: | ||
julia> print(circuit) | julia> print(circuit) | ||
Quantum Circuit Object: | Quantum Circuit Object: | ||
qubit_count: 2 | qubit_count: 2 | ||
Line 37: | Line 36: | ||
}} | }} | ||
</noinclude> | </noinclude> | ||
In the above code section, the Hadamard gate creates an equal superposition of |0⟩ and |1⟩ on the first qubit while the CNOT gate (controlled X gate) creates an entanglement between the two qubits. We find an equal superposition of states |00⟩ and |11⟩, which is the first Bell state. The <code>simulate</code> function allows us to simulate the exact state of the system. | |||
<noinclude> | <noinclude> | ||
julia> state = simulate(circuit) | julia> state = simulate(circuit) | ||
Line 47: | Line 46: | ||
0.7071067811865475 + 0.0im | 0.7071067811865475 + 0.0im | ||
</noinclude> | </noinclude> | ||
<div lang="fr" dir="ltr" class="mw-content-ltr"> | <div lang="fr" dir="ltr" class="mw-content-ltr"> |