Skip to content
Soyoung Shin edited this page Nov 17, 2022 · 5 revisions

General


Exercise 1

  • Use your knowledge of equilateral triangles to work out the value of A using a.

  • Please ensure to add in the Molecule String alphabets in the empty spaces in the first index of the Molecule definition.


Exercise 2

  • Take a look at these docs to learn how to define the Estimator class and what relevant parameters should be passed in when calling the ‘run’ method on it (make sure to also extract the result!). The optimizer function SPSA can be found in these docs where you can learn how to define it and call ‘minimize’ on it.

Exercise 3

  • For the construct_problem function, read over the docs to help you define the ElectronicStructureProblem and the QubitConverter classes. For the custom_vqe function, read over these docs to help you define the Estimator class.

  • Ensure you pass callback to the optimiser for successful graph plotting.

  • Make sure the job variable stores the result from the estimator run which can be obtained using the .result() method.


Exercise 4

  • Reaction energy is the difference between the energy after the reaction and the energy before the reaction.

  • To get these energies, we are interested in the final converged value of the VQE run which will be the last value of the lists.


Exercise 5

  • Total dipole moment can be calculated as the magnitude of a vector.

  • Try to print(result) right after this code block →

vqe_factory = VQEUCCFactory(quantum_instance=StatevectorSimulator(),optimizer=SLSQP(),ansatz=UCC(excitations='sd')) # This is an example of UCC"SD" ansatz

# Solving for the ElectronicStructureProblem`<br>
solver = GroundStateEigensolver(parity_converter, vqe_factory) `<br>
result = solver.solve(problem_reduced)`<br>
  • Comments added : Fill your codes here, dipole moment computed by Nuclear dipole moment - Electronic dipole moment and Electronic dipole moment computed by adding VQE result and ActiveSpaceTransformer extracted energy part

Final Challenge

  • This exercise is completely optional and not required for the advanced badge
  • Check out the examples (i.e. the existing grading code line + the lines marked “Optional”) on how you can use the scoring function to craft how you may attempt this challenge!
  • The scoring is a cumulative function of Circuit score, optimizer iterations and closeness to the reference value. Each of these are weighted with a certain constant. The backend for this challenge is FakeLagos so ensure you are making an ansatz for less than 7 qubits. All characteristics of this backend can be found here
  • The scores are not saved but you are welcome to take screenshots and save your best scores! At the end of the challenge, if you wish you can upload your solutions on this repo (instructions will be provided in slack!)