-
Notifications
You must be signed in to change notification settings - Fork 88
Lab 1
Please ensure you set the correct options for Sampler and Estimator calls
-
Brush up on your Bernstein-Vazirani algorithm knowledge by visiting this section in the Qiskit Textbook.
-
Whenever a bit in the string is '1', we will apply a CNOT during the querying step. Remember that numbers are assigned to bits in a string in Qiskit from right to left.
-
In a list, you can duplicate the elements inside by performing multiplication on the list. For example, for a single-element list, perform [element]*n to give [element, element, element, …] where element is repeated n times.
-
Make sure the number of parameters you pass is equal to the number of circuits!
-
Observables can be built in a particular order based on the given Hamiltonians. See these docs to find out how.
-
Make sure you construct thetas using a list of evenly/linearly spaces values (you can use numpy.linspace).
-
The number of qubits for a circuit has to match the number of qubits in its respective observable. You can check this using “.num_qubits”.
-
The number of parameters in a circuit has to match the number of reps in your respective theta list for that circuit as these values form your parameter values for the circuit. You can check number of parameters for a circuit by using “num_parameters”.
- There are 4 correct answers.
-
Recreate the pictured circuit for your estimator circuit.
-
For each estimator run, you will be using a different operator from the ops list. This is already laid out in the
for
loop. In each loop, you will need to run the estimator circuit for each parameter value in the phases list. -
Make sure you are using the sampler circuit for the sampler run, and vice versa for the estimator run and make sure you pass in options!
-
Make sure the order of observables assigned in the list is as per Qiskit’s qubit numbering.
-
Like exercise 3, check your numbers of qubits and number of parameters match up.
- If your solution to this exercise is not passing, your message is incorrect. Please revisit your solution to Exercise 5 and have a read of the text in the background of the output Figure.