<jupyter_start><jupyter_text>Single Qubit Circuits  Latest python notebook is available [here](https://github.com/q4quanta/quantum-circuits)<jupyter_code># Useful additional packages
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
from math import pi
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from qiskit.tools.visualization import circuit_drawer
from qiskit.quantum_info import state_fidelity
from qiskit import BasicAer

backend = BasicAer.get_backend('unitary_simulator')<jupyter_output><empty_output><jupyter_text>U - gates  1. Single qubit circuit: Base states : |0>, |1><jupyter_code>q = QuantumRegister(1)
qc = QuantumCircuit(q)
qc.u3(pi/2,pi/2,pi/2,q)
qc.draw(output='mpl')
job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)<jupyter_output><empty_output><jupyter_text>1.1. Gates in series<jupyter_code>q = QuantumRegister(1)
qc = QuantumCircuit(q)
qc.u3(pi/2,pi/2,pi/2,q)
qc.u3(pi/2,pi/2,pi/2,q)
qc.draw(output='mpl')
job = execute(qc, backend)
job.result().get_unitary(qc, decimals=3)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12556869881710647, 'fraction_numerical': 0.020018198362147407, 'mean_word_length': 7.8, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '625384', 'license': 'MIT', 'n_tokens_mistral': 446, 'n_tokens_neox': 410, 'n_words': 80, 'path': '4-One-qubit-circuit.ipynb', 'repo_name': 'koiralakp5/Quantum_computation', 'size': '1099'}