Skip to main content

Visualization tool for qoqo quantum computing toolkit by HQS Quantum Simulations

Project description

qollage

Documentation Status GitHub Workflow Status PyPI PyPI - Format Crates.io

Drawing tool for the qoqo quantum toolkit by HQS Quantum Simulations.

Qollage provides the save_circuit and draw_circuit functions that allows users to translate a qoqo circuit into a png image and either save it or display it.
These two functions will create a cache folder named .qollage containing fonts and Typst libraries in the current directory. You are free to delete it but the files will be downloaded again at the next use.
It also provides the circuit_to_typst_str that can be used to generate a string that can be copy pasted in the Typst interpreter if you want to edit the circuit further.
The latest qoqo gates might not be implemented in qollage yet. A circuit containing not supported operations can't be drawn and will result in an error.
If a gate has a string parameter it will be printed inside a typst mathematical expression and the typst symbols will be replaced.
Alphanumerical expressions will be preprocessed, if it doesn't represent any typst symbol it will be escaped by surrounding quotes.
qoqo.operations.RotateX(0, "theta") will be formatted as θ.
qoqo.operations.RotateX(0, "param") will be escaped with quotes and kept as it is.
qoqo.operations.RotateX(0, "\"param\"") will not be accepted because the extra quotes will interfere with the quotes added to escape param.
For more informations see the documentation.
Here is the list of symbols but be aware that not all of them are supported by the font used.

Example:

In a jupyter cell:

from qoqo import Circuit, operations as ops
from qollage import draw_circuit

circuit = Circuit()
circuit += ops.DefinitionBit("ro", 2, True)
circuit += ops.Hadamard(0)
circuit += ops.CNOT(0, 1)
circuit += ops.PauliX(1)
circuit += ops.RotateX(0, "theta")
circuit += ops.MeasureQubit(0, "ro", 0)
circuit += ops.MeasureQubit(1, "ro", 1)

draw_circuit(circuit)

It will output:

Example

General Notes

This software is still in the beta stage. Functions and documentation are not yet complete and breaking changes can occur.

Contributing

We welcome contributions to the project. If you want to contribute code, please have a look at CONTRIBUTE.md for our code contribution guidelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qollage-0.1.0.tar.gz (198.5 kB view details)

Uploaded Source

Built Distributions

qollage-0.1.0-cp312-none-win_amd64.whl (15.1 MB view details)

Uploaded CPython 3.12 Windows x86-64

qollage-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (13.2 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

qollage-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl (14.1 MB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

qollage-0.1.0-cp311-none-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

qollage-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (13.2 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

qollage-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl (14.1 MB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

qollage-0.1.0-cp310-none-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.10 Windows x86-64

qollage-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (13.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

qollage-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl (14.1 MB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

qollage-0.1.0-cp39-none-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.9 Windows x86-64

qollage-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (13.2 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

qollage-0.1.0-cp39-cp39-macosx_10_12_x86_64.whl (14.1 MB view details)

Uploaded CPython 3.9 macOS 10.12+ x86-64

qollage-0.1.0-cp38-none-win_amd64.whl (15.1 MB view details)

Uploaded CPython 3.8 Windows x86-64

qollage-0.1.0-cp38-cp38-macosx_11_0_arm64.whl (13.2 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

qollage-0.1.0-cp38-cp38-macosx_10_12_x86_64.whl (14.1 MB view details)

Uploaded CPython 3.8 macOS 10.12+ x86-64

File details

Details for the file qollage-0.1.0.tar.gz.

File metadata

  • Download URL: qollage-0.1.0.tar.gz
  • Upload date:
  • Size: 198.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f6b94856070aa0c737688416766da850477ef7b8b60cb049dc68c08a8c7d68dd
MD5 413031cc38ed2cc02dea5744a4842e33
BLAKE2b-256 f65690097a6115dce230ff70f764a4ff8b8bce7ebbef31b2e509f1ca001f5380

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp312-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.1.0-cp312-none-win_amd64.whl
  • Upload date:
  • Size: 15.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.1.0-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 dca9503eae29ae86cb0f65bd6ff61995758d63b1b4f3a1553c577be0147ae6f2
MD5 f31a02cc122f23b66b163a9520a407f2
BLAKE2b-256 9c8c42b0bcba21b240f5a8f7355636c7b98815eb55a74f09891956226243d940

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a963bd5226d2fdabb8554575f5a4440e64117949aa5c0b98b4b98aee9b81e9f
MD5 96653a2ecff00e951a423411676389f2
BLAKE2b-256 ab95ce87abafa82d3cf5901c56e92f5c179c390af43b18a761980d9f71068b95

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c21479633e5caabcb9afc413c53d52a39937a04d99770d5d5bc57a0ed76d824d
MD5 24ae4c1e911f2a047819cb5e6fbf0715
BLAKE2b-256 c5b524499596662826092bc3de300d2fd66dc4617492881fd26f35743b27bb39

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp311-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.1.0-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.1.0-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 11d0951b058a32af4d022fe1700f3e546bb688a22581f69fd3ab5e66555f3e2f
MD5 a02a6789f0615504c769704f12726ec2
BLAKE2b-256 23df95c8424b0427b4e3cedec4e498d76be27bc0baf8cd27ea9100b59bc9fb75

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 676be28e024e6b8c2a2a8bcf5a4888d954057f7fd980d723814752184c2afdba
MD5 1fe301bdee5b360efb66261d3838ef67
BLAKE2b-256 86eb3aa7d978162fb556cd7da8aa6ba7d642d601cf794695e5a8a81b7cc60d5e

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 56622a7b743a90b647e12360ccf0f926b1ea2cd0ac0ea1d3d8d84400aed97b8c
MD5 26d0ee47a06cb574b016a4fe942bea52
BLAKE2b-256 426b19b973fe52a8c2b9ac60c4fa850ae636cabf2dcf702c3cbb13ee43b1ea2d

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp310-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.1.0-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.1.0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 47621ba777b3eeef43ecb52f420b6ea129a0e47c49f5c790cfc34db96a21fd03
MD5 83dc38402691640d14e52bca50f00590
BLAKE2b-256 a6f4ca2970f6df28fb8186ad9179e57f36f4cba7f55f8922dffd4e577168f39e

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d81cbdcd35fc0c293c732676704b61de7883f81a9c7afda8e08a05ad7b09bbc
MD5 327c45ddf0ecc598611813c6a6b6954e
BLAKE2b-256 da381cbb25bf13bbe84111c196dacd8ff0f46faf3038bd17e90347383b9985d8

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 34e5e4b8247728b28b5f26934b4ba58792bcb9c0d30bdab7e3bfb956613eb7e7
MD5 65c52590158078a84b7c96fff036ad68
BLAKE2b-256 be8ec4afcb77fb87eeba8b1c99d2c55f63b2c82648ddec9a08d94f47bd5fc611

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp39-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.1.0-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.1.0-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 cc4401822cbf4a16068e3fa1b6aea969c4e0bb7ffe7f8990c29959c09e6bc9f7
MD5 4874eb500891012f30b1054161827a79
BLAKE2b-256 d8a041e1ab5399f8ed4e47f19403074aaf7d346f959f95f0c3aa7898d5821dd3

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e66301046fe7688db01292b5a4a7d21aa305cee437fc84877a59ba452988b264
MD5 b9986d21a7eebcf5cb99b09bb7c79931
BLAKE2b-256 1466e79627f8555276e176a1514b70eabdc0f1159dab3c1c7fd47253c0121238

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 160482afc6afa76061f1a76933cb810769eb3656ef309874e9acc7592749d553
MD5 983188954bc206ad04b2e3a55810aacf
BLAKE2b-256 731755780759462a3b74636722334a27ac1f2d378cc07e921a33474ea110b24f

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp38-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.1.0-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 15.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.1.0-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 a431fac7d9d08bf93c059a19718733ba87b2c2fa9bd17529653ef87d60fc8de0
MD5 83e3a55500f1187c2e681f9b07755fd0
BLAKE2b-256 87814505eaddb60a217ac9102cbddb01ff565dad478d7c9802eeccd516bba7d2

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a1436821ad6275be2b518c8819bb9057b9f0784b9726ff043136314915b02c2
MD5 127de149abd4c64277c0b3d017e0a5f4
BLAKE2b-256 fbced830cc824eb41bef2cfe91619556c49f6d135913f4d385d48f4cc4837e1e

See more details on using hashes here.

File details

Details for the file qollage-0.1.0-cp38-cp38-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.1.0-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5911bd521847bd8a94f796b7df8160014520ef422329bf40ed9c3a6cb36b04ce
MD5 c4166a85fe1aeb095e1ec916a5fd859e
BLAKE2b-256 2dee5ff875c451f1f36b1c019004382dd84db549ee64b68828051d5303ac5f54

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page