├── Grober.crystal ├── README.md └── LICENSE /Grober.crystal: -------------------------------------------------------------------------------- 1 | from ibm_quantum_widgets import CircuitComposer 2 | from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit 3 | from numpy import pi 4 | 5 | qreg_q = QuantumRegister(2, 'q') 6 | creg_c = ClassicalRegister(2, 'c') 7 | circuit = QuantumCircuit(qreg_q, creg_c) 8 | 9 | circuit.reset(qreg_q[0]) 10 | circuit.reset(qreg_q[1]) 11 | circuit.cz(qreg_q[0], qreg_q[1]) 12 | circuit.h(qreg_q[1]) 13 | circuit.x(qreg_q[0]) 14 | circuit.x(qreg_q[1]) 15 | circuit.h(qreg_q[0]) 16 | circuit.h(qreg_q[1]) 17 | circuit.x(qreg_q[0]) 18 | circuit.x(qreg_q[1]) 19 | circuit.h(qreg_q[0]) 20 | circuit.sxdg(qreg_q[1]) 21 | circuit.rxx(pi / 2, qreg_q[0], qreg_q[1]) 22 | circuit.h(qreg_q[1]) 23 | circuit.measure(qreg_q[0], creg_c[1]) 24 | circuit.z(qreg_q[1]) 25 | circuit.cz(qreg_q[0], qreg_q[1]) 26 | circuit.measure(qreg_q[0], creg_c[0]) 27 | circuit.h(qreg_q[1]) 28 | circuit.z(qreg_q[0]) 29 | 30 | 31 | editor = CircuitComposer(circuit=circuit) 32 | editor 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IBM-Quantum-Lab-Grover 2 | Grover’s algorithm example 3 | ------ 4 | ![grover-circ](https://user-images.githubusercontent.com/13979489/201800648-0866b557-f942-47e9-a99f-6f15959f13f5.png) 5 | 6 | 7 | Perhaps even stranger than Bell states are their three-qubit generalization, the GHZ states. An example of a GHZ state 8 | 9 | GHZ states are named after Greenberger, Horne, and Zeilinger, who were the first to study them in 1989. GHZ states are also known as “Schrödinger cat states” or just “cat states.” 10 | 11 | ## W states vs. GHZ states 12 | 13 | How else can three qubits be entangled? W states are another way to entangle three qubits, with an important difference from GHZ states: W states are more robustly entangled when a qubit is lost. Let’s look at what that means. 14 | 15 | The residual entanglement is useful. For example, we can use it to successfully teleport a qubit two-thirds of the time. Consider the following circuit: 16 | 17 | ![w-measure2](https://user-images.githubusercontent.com/13979489/201800794-5602792f-600a-4f53-86af-d23420324919.png) 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Pourya 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------