View on GitHub
Open this notebook in GitHub to run it yourself
QNum variables.
You can try different optimization scenarios, below we introduce two examples:
- Optimizing over depth and constraining the maximal width to 10 qubits.
- Optimizing over depth and constraining the maximal width to 12 qubits.
Output:
Output:
| x | y | z | counts | probability | bitstring | |
|---|---|---|---|---|---|---|
| 0 | 3 | 0 | 1 | 275 | 0.134277 | 1011 |
| 1 | 1 | 1 | 1 | 274 | 0.133789 | 1101 |
| 2 | 3 | 1 | 1 | 261 | 0.127441 | 1111 |
| 3 | 0 | 1 | 0 | 255 | 0.124512 | 0100 |
| 4 | 2 | 0 | 1 | 253 | 0.123535 | 1010 |
| 5 | 2 | 1 | 1 | 252 | 0.123047 | 1110 |
| 6 | 0 | 0 | 0 | 242 | 0.118164 | 0000 |
| 7 | 1 | 0 | 0 | 236 | 0.115234 | 0001 |
Output:
Output:
| x | y | z | counts | probability | bitstring | |
|---|---|---|---|---|---|---|
| 0 | 2 | 0 | 1 | 271 | 0.132324 | 1010 |
| 1 | 0 | 1 | 0 | 266 | 0.129883 | 0100 |
| 2 | 0 | 0 | 0 | 260 | 0.126953 | 0000 |
| 3 | 3 | 1 | 1 | 258 | 0.125977 | 1111 |
| 4 | 1 | 0 | 0 | 254 | 0.124023 | 0001 |
| 5 | 1 | 1 | 1 | 254 | 0.124023 | 1101 |
| 6 | 2 | 1 | 1 | 245 | 0.119629 | 1110 |
| 7 | 3 | 0 | 1 | 240 | 0.117188 | 1011 |