#!pip install qiskit
# Do the usual setup, but without classical registers or measurement
import numpy as np
from qiskit import QuantumCircuit, QuantumRegister, execute

qr = QuantumRegister(1)
circ = QuantumCircuit(qr)



# Place an Ry gate with a −3π/4 rotation
circ.ry(-3/4 * np.pi, qr[0])

# Draw the circuit
circ.draw(output='mpl')


# Use the BasicAer statevector_simulator backend
from qiskit import BasicAer
backend_sv_sim = BasicAer.get_backend('statevector_simulator')

job_sim = execute(circ, backend_sv_sim)
result_sim = job_sim.result()
quantum_state = result_sim.get_statevector(circ, decimals=3)

# Output the quantum state vector
quantum_state

# Plot the state vector on a Bloch sphere
from qiskit.tools.visualization import plot_bloch_multivector
plot_bloch_multivector(quantum_state)

# Do the usual setup, but without classical registers or measurement
import numpy as np
from qiskit import QuantumCircuit, QuantumRegister, execute

qr = QuantumRegister(1)
circ = QuantumCircuit(qr)

# Place gates that will achieve the desired state


# Draw the circuit
circ.draw(output='mpl')


# Use the BasicAer statevector_simulator backend
from qiskit import BasicAer
backend_sv_sim = BasicAer.get_backend('statevector_simulator')

job_sim = execute(circ, backend_sv_sim)
result_sim = job_sim.result()
quantum_state = result_sim.get_statevector(circ, decimals=3)

# Output the quantum state vector
quantum_state

# Plot the state vector on a Bloch sphere
from qiskit.tools.visualization import plot_bloch_multivector
plot_bloch_multivector(quantum_state)