import cirq
from cirq import Simulator
import numpy as np

#instantiate simulator
simulator = Simulator()

#instantiate qubit
qubits = cirq.LineQubit.range(3)

#make circuit
circuit = cirq.Circuit()
circuit.append(cirq.H(qubits[0]))
circuit.append(cirq.CNOT(qubits[0], qubits[1]))
circuit.append(cirq.H(qubits[2]))
circuit.append(cirq.Z(qubits[2])**0.5)

#print circuit
print(circuit)

#space the outputs
print("\n\n\n")

#print the statevectors
result = simulator.simulate(circuit)
print(np.around(result.final_state_vector, 3))


