# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
# %matplotlib inline
# Importing standard Qiskit libraries
from qiskit import QuantumCircuit, execute, Aer, IBMQ, BasicAer
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from ibm_quantum_widgets import *


from qiskit_textbook.tools import random_state, array_to_latex

from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
from qiskit.quantum_info import Statevector, random_statevector
from qiskit.visualization import plot_state_qsphere, state_visualization, plot_bloch_multivector
from qiskit.visualization import plot_state_city, plot_state_paulivec, plot_state_hinton

# Loading your IBM Q account(s)
provider = IBMQ.load_account()
provider
# -

from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from numpy import pi
from math import pi, atan, sqrt, sin, cos, acos
#from coldquanta.qiskit_tools.coldquanta_sim_backend import ColdQuantaSimBackend

# +
# #!pip install coldquanta
# -

plot_bloch_vector([1,0,0])

plot_bloch_vector([0,0,1])







# +
# hadamard
qreg_q = QuantumRegister(1, 'q')
creg_c = ClassicalRegister(1, 'c')
qc = QuantumCircuit(qreg_q, creg_c)

qc.h(0)

sv = Statevector.from_instruction(qc).data
plot_state_qsphere(sv)

# +
quantum_state = sv

plot_state_city(quantum_state)
# -

plot_state_hinton(quantum_state)

plot_bloch_multivector(quantum_state)

# +

qreg_q = QuantumRegister(1, 'q')
creg_c = ClassicalRegister(1, 'c')
qc = QuantumCircuit(qreg_q, creg_c)

qc.reset(qreg_q[0])
qc.ry(2*pi/3, qreg_q[0])

sv = Statevector.from_instruction(qc).data
plot_state_qsphere(sv)
# -

plot_state_city(sv)

plot_state_hinton(sv)

plot_bloch_multivector(sv)





# +
import numpy as np

n = 6
qc = QuantumCircuit(n, n)

for i in range(n-1):
    qc.h(i)
    qc.rz(2*np.pi/n, i)

sv = Statevector.from_instruction(qc).data
plot_state_qsphere(sv)

# +
n = 6
qc = QuantumCircuit(n, n)

for i in range(n-1):
    qc.h(i)
    qc.rz(3*np.pi/n, i)

sv = Statevector.from_instruction(qc).data
plot_state_qsphere(sv)
# -

from qiskit.visualization import plot_bloch_vector, plot_bloch_multivector
from qiskit.visualization import 
plot_bloch_multivector(sv)



StarcoderdataJupyterScriptsDedupFiltered