classiq-library icon indicating copy to clipboard operation
classiq-library copied to clipboard

Add initial conditions to the arithmetic example in the arithmetic_expressions notebook

Open TomerGoldfriend opened this issue 1 year ago • 0 comments

The Arithmetic Expressions notebook demonstrates the capabilities of the Classiq's synthesis engine, in the framework of quantum arithmetics. The notebook shows a single quantum model, consisting a complex arithmetic expression, and synthesizes it with two different optimization scenarios.

The example in the notebook does not include an execution of the resulting quantum programs. Moreover, execution of the current example will result in a non-indicative measurement, as the arithmetic expression operates on two quantum variables, x and y, which are initialized to the zero state, and the result of the expression is trivial.

The goal of this issue is to add initial conditions and execution to the arithmetic_expressions notebook. To complete this issue, follow these steps:

  1. Open the Arithmetic Expressions notebook, using any jupyter editor (e.g. jupyter lab, google colab, etc).
  2. In the quantum model, replace the allocate calls for the quantum numbers x and y with appropriate prepare_int calls.
  3. For the two quantum programs in the notebook, add an execute call, print the results and compare to the expected result.
  4. Make sure to run the write_qmod line, which will automatically update the .qmod files for this example.
  5. Make sure the notebook looks well, does not have any typos / mistakes, and is running properly.
  6. Follow the contribution guidelines to open a pull request.
  7. Commit all the files changed under the tutorials/technology_demonstrations/arithmetic_expressions/ directory.
  8. If you have any questions or comments, you can ask them here in the issue, or in our slack community, and the Classiq team will be happy to assist.

Happy quantum coding!

TomerGoldfriend avatar May 01 '24 12:05 TomerGoldfriend