Quantum States: Exercises


1. Creating a Quantum State Vector. In quantum computing, a quantum state is represented as a state vector. You can create a quantum state vector using a NumPy array.

In this exercise, you will reate a quantum state vector for the state |0⟩, which is represented as [1, 0].


import numpy as np # Create a quantum state vector for |0⟩ state_vector = np.array([___, ___]) # Create a quantum state vector for |0⟩ state_vector = np.array([1, 0]) test_object("state_vector") success_msg("You have created a quantum state vector.")
To create a quantum state vector, use `np.array()`.

Previous Exercise Next Exercise