Skip to content

Commit

Permalink
nadavs comments about links
Browse files Browse the repository at this point in the history
  • Loading branch information
Dror Segman authored and Dror Segman committed Feb 23, 2025
1 parent 8e826f1 commit 30ec64b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tutorials/Classiq_tutorial/Qmod_tutorial_part1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@
" - Function `main` declares parameter `q` thus: `q: Output[QBit]`. In this case, `q` is an output-only parameter - it is initialized inside the scope of `main`.\n",
" \n",
" Prior to their initialization, local quantum variables and output parameters do not reference any object (this is analogous to null reference in conventional languages). They may be initialized in the following ways:\n",
" - Using `allocate` to initialize the variable to a new object, with all its qubits in the default $|0\\rangle$ state.\n",
" - Using numeric assignment to initialize the variable to an object representing the result of a quantum expression.\n",
" - Using functions with output parameters (for example, `prepare_state`).\n",
" - Using [`allocate`](https://docs.classiq.io/latest/qmod-reference/api-reference/operations/?h=allocate#classiq.qmod.builtins.operations.allocate) to initialize the variable to a new object, with all its qubits in the default $|0\\rangle$ state.\n",
" - Using [numeric assignment](https://docs.classiq.io/latest/qmod-reference/language-reference/statements/numeric-assignment/) to initialize the variable to an object representing the result of a quantum expression.\n",
" - Using functions with output parameters (for example, [state preparation](https://docs.classiq.io/latest/qmod-reference/library-reference/core-library-functions/prepare_state_and_amplitudes/prepare_state_and_amplitudes/)).\n",
" \n",
" Note: all the variables in `main` must be declared as `Output`, as `main` is the entry point of the model (Think about it: where could a variable be initialized before `main` was called?). Other functions can declare parameters with or without the `Output` modifier.\n",
" "
Expand Down Expand Up @@ -194,13 +194,13 @@
"source": [
"### Exercise #2 - The Repeat Statement\n",
"\n",
"Use Qmod's [`repeat`](https://docs.classiq.io/latest/qmod-reference/language-reference/statements/classical-control-flow/#classical-repeat) statement to create your own Hadamard Transform - a function that takes a `QArray` of an unspecified size and applies `H` to each of its qubits.\n",
"Use Qmod's `repeat` statement to create your own Hadamard Transform - a function that takes a `QArray` of an unspecified size and applies `H` to each of its qubits.\n",
"\n",
"Instructions:\n",
"1. Define a function `my_hadamard_transform`:\n",
" - It should have a single `QArray` argument `q`.\n",
" - Use repeat to apply `H` on each of `q`'s qubits.\n",
" - Note that the `iteration` block of the `repeat` statement must use the Python `lambda` syntax.\n",
" - Use `repeat` to apply `H` on each of `q`'s qubits.\n",
" - Note that the `iteration` block of the `repeat` statement must use the Python `lambda` syntax (see `repeat` [documentation](https://docs.classiq.io/latest/qmod-reference/language-reference/statements/classical-control-flow/#classical-repeat)).\n",
"2. define a `main` function that initializes a `QArray` of length 10, and then passes it to `my_hadamard_transform`.\n",
"\n",
"The provided code continues by calling `show` to let you inspect the resulting circuit - make sure that is applies `H` to each of `q`'s qubits."
Expand Down

0 comments on commit 30ec64b

Please sign in to comment.