Skip to content

hhat-lang/hhat_lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

H-hat quantum programming language

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages