Use this file to discover all available pages before exploring further.
View on GitHub
Open this notebook in GitHub to run it yourself
The functions prepare_uniform_trimmed_state and prepare_uniform_interval_state create states with uniform superposition over a discrete interval of the possible states.Both scale polynomially with the number of qubits.
result = execute(qprog).result_value()counts = result.parsed_counts
plt.figure(figsize=(4, 3))plt.bar( [c.state["x"] for c in counts], [c.shots for c in counts], color="skyblue", edgecolor="black",)plt.xlabel("state")plt.ylabel("shots")
result = execute(qprog).result_value()counts = result.parsed_counts
plt.figure(figsize=(5, 3))plt.bar( [c.state["x"] for c in counts], [c.shots for c in counts], color="skyblue", edgecolor="black",)plt.xlabel("state")plt.ylabel("shots")