Skip to main content

H-hat: a high level abstraction quantum programming language.

Project description

Unitary Fund

H-hat

$\hat{H}$ (H-hat) is a high abstraction quantum programming language.

Disclaimer: This is a work still in early stages and may be seeing as such. So errors, inconsistencies, tons of experimentation, modifications and trials will happen.


Note: Documentation is in progress and can be found here.


Contents


Summary

  • A (high level) quantum algorithms builder
  • Handling output quantum data with contextualized meaning
  • Quantum and classical variables are arrays of data
  • No qubit approach: it will be handled by the language as operations (quantum) on indexes; The interpreter/compiler will be responsible to transpile it to low level QASM instructions
  • Convert high level languages commands and procedures into low level quantum instructions for quantum languages such as openQASM, cQASM, NetQASM, Q1ASM to be executed on their respective hardware/simulator
  • Debugging results and quantum processes through post-measurement analysis (probably)

Objectives

  • Provide an intermediate picture between classical high-level and QASM (or QIR)-like programming languages
  • Make use of basic and complex quantum instructions and procedures in a qubit-free environment
  • Bring light to measurement results and their analysis
  • Be simples enough to be used by software developers with little knowledge on quantum computing
  • Prepare the path for quantum devices with hundreds or thousands of qubits
  • Integrate with common programming languages through function calls
  • Integrate with quantum hardware and compilers
  • Debugging through (partial) quantum analysis of measurement results for results and inner processes comparing them to simulated ones (using fisher information, linear entropy, entanglement measurements, etc)

Features

  • simple syntax
  • array-like programming approach
  • quantum functions for quantum data
  • quantum commands and quantum data are referred with @ before the word, i.e. @init, @sync, @q1
  • measurements automatically made after executing quantum variable content through interaction with classical functions and classical data
  • measurement result contextualized according to the data type it is interacting with

Installation

Setting up a virtual environment

In case you don't know how to set up a virtual environment, see the examples below (choose only one):

Using conda

  • Install anaconda.
  • Create an environment for h-hat and activate it: conda activate <name_of_the_env>

Using venv

  • Create a venv: python3.10 -m venv .venv (the venv will be located in the folder .venv inside the hhat_lang root folder)
  • Deactivate any other environment you might have active, i.e. conda: conda deactivate, until you have no environment
  • Activate our new venv through: source .venv/bin/activate

PYPI installation

After setting up your virtual environment, simply use:

python3 -m pip install hhat-lang

Development mode

In the root folder, run:

python3 -m pip install -e .

Executing Code

After proceeding on your preferred installation method, it's time to run some code. Just type hhat in the terminal followed by the file containing your code (.hat extension).


Progress

You can follow the progress in the TODOs list.


Got an error?

Open an issue!


License

MIT


Credits

Code is being developed by Doomsk. The author thanks Kaonan, T1t0, Anneriet, Penguim and Lucasczpnk for great discussions and help on developing the first language concepts.

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

hhat-lang-0.1.0a8.tar.gz (19.7 kB view details)

Uploaded Source

File details

Details for the file hhat-lang-0.1.0a8.tar.gz.

File metadata

  • Download URL: hhat-lang-0.1.0a8.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for hhat-lang-0.1.0a8.tar.gz
Algorithm Hash digest
SHA256 b7ed31b85ac07bf680acc367295661ccc82b9532fb470517d03562b7d629301c
MD5 f72883c35256fce590cc7fc2b1e9975d
BLAKE2b-256 63f2cad17a64209dc5572476a03991c11988653fd1796460f4a76dbee9b8a85d

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