A GHZ quantum circuit is a quantum computing system that includes 3 entangled qubits.
A Greenberger–Horne–Zeilinger state (GHZ state) is a certain type of entangled quantum state that involves at least three subsystems.
Demo in IBM Quantum Composer.
| def swap(b, a): | |
| """ | |
| A quantum circuit that swaps the input bits. | |
| 01 => 10 | |
| """ | |
| swap = QuantumCircuit(2, 2) | |
| if a: | |
| swap.x(0) | |
| if b: |
| def four_bell_states(): | |
| """ | |
| Create all 4 Bell states. | |
| https://quantumcomputing.stackexchange.com/a/2260 | |
| """ | |
| # [00, 11] positive | |
| qc = QuantumCircuit(2) | |
| qc.h(0) | |
| qc.cx(0, 1) |
| from qiskit import qiskit, QuantumCircuit | |
| def execute(func): | |
| print('0 0: {}'.format(func(0, 0))) | |
| print('0 1: {}'.format(func(0, 1))) | |
| print('1 0: {}'.format(func(1, 0))) | |
| print('1 1: {}'.format(func(1, 1))) | |
| def xor(a, b): | |
| """ |
| from warnings import simplefilter | |
| from numpy import math | |
| from qiskit import QuantumCircuit, qiskit, Aer | |
| from qiskit.visualization import plot_bloch_multivector | |
| from qiskit.circuit.quantumregister import QuantumRegister | |
| import matplotlib.pyplot as plt | |
| def problem1(): | |
| qc = QuantumCircuit(1, 1) | |
| qc.ry(3 * math.pi / 4, 0) |
| # | |
| # Programmatically detect the version of the Chrome web browser installed on the PC. | |
| # Compatible with Windows, Mac, Linux. | |
| # Written in Python. | |
| # Uses native OS detection. Does not require Selenium nor the Chrome web driver. | |
| # | |
| import os | |
| import re | |
| from sys import platform |
| using System.CodeDom.Compiler; | |
| using System.Collections.Generic; | |
| using System.Collections; | |
| using System.ComponentModel; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Globalization; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Reflection; | |
| using System.Runtime.Serialization; |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Diagnostics; | |
| namespace test | |
| { | |
| class Program | |
| { | |
| private static int[] GenerateRandomList1(int size) |