DumpMachine with a python host program
Originally opened by @jsvandyke86 here
Hello,
I'm going through this tutorial ("Qubit-level programming") using a python host program, and it seems like DumpMachine() is not quite working as expected. Rather than the output given on the tutorial webpage, it seems to be producing a dictionary (or something like that) which contains multiple different representations of desired information (plain text, html, etc.). I'm not quite sure how to turn this into human-readable format. Thanks for the help! Here is the output that I get:
{'text/plain': '|0⟩\t0.35355339059327384 + 0𝑖\n|1⟩\t0.35355339059327384 + 0𝑖\n|2⟩\t0.35355339059327384 + 0𝑖\n|3⟩\t0.35355339059327384 + 0𝑖\n|4⟩\t0.35355339059327384 + 0𝑖\n|5⟩\t0.35355339059327384 + 0𝑖\n|6⟩\t0.35355339059327384 + 0𝑖\n|7⟩\t0.35355339059327384 + 0𝑖', 'text/html': '\r\n
| Qubit IDs | \r\n0, 1, 2 | \r\n|||
|---|---|---|---|---|
| Basis state (little endian) | \r\nAmplitude | Meas. Pr. | Phase | \r\n|
| $\left|0\right\rangle$ | \r\n$0.3536 + 0.0000 i$ | \r\n \r\n\r\n <progress\r\n max="100"\r\n value="12.500000000000005"\r\n style="width: 100%;"\r\n > \r\n | \r\n \r\n \r\n | \r\n \r\n \r\n \r\n \r\n ↑\r\n | \r\n \r\n
| $\left|1\right\rangle$ | \r\n$0.3536 + 0.0000 i$ | \r\n \r\n\r\n <progress\r\n max="100"\r\n value="12.500000000000005"\r\n style="width: 100%;"\r\n > \r\n | \r\n \r\n \r\n | \r\n \r\n \r\n \r\n \r\n ↑\r\n | \r\n \r\n
| $\left|2\right\rangle$ | \r\n$0.3536 + 0.0000 i$ | \r\n \r\n\r\n <progress\r\n max="100"\r\n value="12.500000000000005"\r\n style="width: 100%;"\r\n > \r\n | \r\n \r\n \r\n | \r\n \r\n \r\n \r\n \r\n ↑\r\n | \r\n \r\n
| $\left|3\right\rangle$ | \r\n$0.3536 + 0.0000 i$ | \r\n \r\n\r\n <progress\r\n max="100"\r\n value="12.500000000000005"\r\n style="width: 100%;"\r\n > \r\n | \r\n \r\n \r\n | \r\n \r\n \r\n \r\n \r\n ↑\r\n | \r\n \r\n
| $\left|4\right\rangle$ | \r\n$0.3536 + 0.0000 i$ | \r\n \r\n\r\n <progress\r\n max="100"\r\n value="12.500000000000005"\r\n style="width: 100%;"\r\n > \r\n | \r\n \r\n \r\n | \r\n \r\n \r\n \r\n \r\n ↑\r\n | \r\n \r\n
| $\left|5\right\rangle$ | \r\n$0.3536 + 0.0000 i$ | \r\n \r\n\r\n <progress\r\n max="100"\r\n value="12.500000000000005"\r\n style="width: 100%;"\r\n > \r\n | \r\n \r\n \r\n | \r\n \r\n \r\n \r\n \r\n ↑\r\n | \r\n \r\n
| $\left|6\right\rangle$ | \r\n$0.3536 + 0.0000 i$ | \r\n \r\n\r\n <progress\r\n max="100"\r\n value="12.500000000000005"\r\n style="width: 100%;"\r\n > \r\n | \r\n \r\n \r\n | \r\n \r\n \r\n \r\n \r\n ↑\r\n | \r\n \r\n
| $\left|7\right\rangle$ | \r\n$0.3536 + 0.0000 i$ | \r\n \r\n\r\n <progress\r\n max="100"\r\n value="12.500000000000005"\r\n style="width: 100%;"\r\n > \r\n | \r\n \r\n \r\n | \r\n \r\n \r\n \r\n \r\n ↑\r\n | \r\n \r\n
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 03e2309f-755c-a15d-74d5-98551eafd024
- Version Independent ID: 5b02cf95-725d-5e26-055e-c5d8fe9387a0
- Content: Write and simulate qubit-level programs in Q# - Microsoft Quantum
- Content Source: articles/tutorials/qubit-level.md
- Product: quantum
- GitHub Login: @gillenhaalb
- Microsoft Alias: a-gibec
I think this may have been fixed as the result of improving some of our display data handling recently. @anjbur, let's try and see if we can reproduce this; if not, I'm happy to recommend closing the issue as Resolved-Done. Thanks!