- Build a circuit to prepare the 3 qubit GHZ state
$| \psi \rangle_{GHZ}$ . Verify your circuit withCircuit.get_statevector()
orAerStateBackend
.
Can you define a function build_ghz_circ
which builds a circuit to prepare an
-
Take a look at the Quantum Fourier transform as implemented in the intro notebook. Can you define a function
build_qft_circ(n_qubits)
that builds a circuit for the Quantum Fourier Transform for$n$ qubits?
(a) Define a custom rebase to the
(b) Define a SequencePass
which optimises a Circuit
using FullPeepholeOptimise
before applying the rebase defined above. Test out this rebase pass on the circuits you have made so far.
- Shown below is a circuit that performs the SWAP test. This circuit can be used to calculate the inner product between the states prepared in the registers
$p$ and$q$ . In the circuit the registers$p$ and$q$ contain 1 qubit however this test works for registers of any size.
If we measure qubit
Use the AerBackend
to calculate the inner product
Note that here
- Write a pytket CustomPass that iterates through a
Circuit
and eliminates parameterised gates with small angles. Can you make a method where we can set a threshold for a gate to be eliminated?
- (BONUS) Write your
Backend
that can run simulations of a pytketCircuit
for a gateset of your choice. You can use this notebook tutorial as a guide.