View on GitHub
Open this notebook in GitHub to run it yourself
Examples
The calculation of -5 * 3 = - 1- The left arg -5 is represented as 1011 and 3 as
- The number of digits needed to store the answer is 4+2-1 =
- The multiplication is done in the ‘regular’ manner where each number is extended to five bits and only five digits are kept in the intermediary results.
Examples
Example 1: Two Quantum Variables Multiplication
This code example generates a quantum program that multiplies two arguments. Both of them are defined as quantum variables of sizeOutput:
Example 2: Float and Quantum Variable Multiplication
This code example generates a quantum program that multiplies two arguments. Here, the left argument is a fixed-point number (3.5), and the right argument is a quantum variable of sizeOutput: