Consider again the entangled state that we saw earlier,

This state is called a Bell state, and it has 3 siblings:

Together, these states form the Bell basis. Write a set of 4 circuits that prepare and return each of the four Bell states.

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

# Starting from the state |00>, implement a PennyLane circuit
# to construct each of the Bell basis states.


@qml.qnode(dev)
def prepare_psi_plus():
##################
# YOUR CODE HERE #
##################

# PREPARE (1/sqrt(2)) (|00> + |11>)

return qml.state()


@qml.qnode(dev)
def prepare_psi_minus():
##################
# YOUR CODE HERE #
##################

# PREPARE (1/sqrt(2)) (|00> - |11>)

return qml.state()


@qml.qnode(dev)
def prepare_phi_plus():
##################
# YOUR CODE HERE #
##################

# PREPARE (1/sqrt(2)) (|01> + |10>)

or to submit your code

To interact with codercises, please switch to a larger screen size.

Learning Objectives:

  • Use this as a reference for all your single- and multi-qubit gate needs!
  • Prepare two-qubit states by combining single- and two-qubit gates.