Skip to content

Instantly share code, notes, and snippets.

@pdc-quantum
Last active March 16, 2022 21:17
Show Gist options
  • Save pdc-quantum/9595a0d220134e4bedc32a8706f0266f to your computer and use it in GitHub Desktop.
Save pdc-quantum/9595a0d220134e4bedc32a8706f0266f to your computer and use it in GitHub Desktop.
import numpy as np
from qiskit import QuantumCircuit
init_list = np.array([0., 0., 0., 2., 0., -1., -1., 0.,
0., -1., -1., 0., 2., 0., 0., 0.]) / ( 2*np.sqrt(3) )
circuit = QuantumCircuit(4)
circuit.initialize(init_list, circuit.qubits)
# add Pauli-Z measurements and draw the circuit
circuit.measure_active()
circuit.draw(output='mpl')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment