# The turning qubit from rotate.py, in PennyLane. Run it on your own computer:
#   pip install pennylane
#   python3 pennylane_rotate.py
import math
import pennylane as qml

dev = qml.device("default.qubit", wires=1)


@qml.qnode(dev)
def turn(angle):
    qml.RY(angle, wires=0)
    return qml.probs(wires=0)


for step in range(9):
    angle = step * math.pi / 8
    print(f"  {step}/8 pi   chance of 1: {float(turn(angle)[1]):.3f}")
