Skip to content

H-hat quantum language

Unitary Foundation Discord Chat

Warning

This is a work in progress and may be seeing as such. Errors, inconsistencies, tons of experimentation, modifications and trials are happening. Until there is a stable version, it is prone to breaking changes.

What H-hat is

  • A quantum programming language family and the ecosystem to build it
  • An abstraction layer above QASM-like languages
  • A language to
    • Use higher-level abstraction to harness quantum resources, such as superposition, entanglement, etc.
    • Need no specialized knowledge on quantum mechanics or quantum information theory
    • Close the gap between developers/programmers/computer scientists and quantum physicists
    • Use quantum data and quantum data structures to reason about quantum information processing
    • Solve problems using quantum logic, rather than Quantum Mechanics approach

What H-hat is not

  • A replacement for quantum logic-level quantum computation (circuit-like quantum computing, for instance), such as QASM-like languages
  • A full stack programming language with direct access to the hardware
  • A simulator
  • A replacement for Quantum Mechanics

Language features

  • Code reasoning closer to classical programming languages
  • Quantum data types, variables, functions just as its classical counterpart
  • Additionally, there is quantum primitives to define some general platform-dependent instruction set
  • Classical and quantum parts have similar syntaxes and components
  • Quantum variables:
    • hold quantum and classical instructions
    • execute its content and perform measurement once a cast function is called upon it
    • re-execute the same data content every time it is cast
  • Platform- and quantum logic language- independent
  • Can hold many syntaxes/dialects implementations to work in harmony with each other

Code Organization

The code is organized by the development language chosen to develop H-hat, also known as main development language (MDL). For instance, a python/ folder will contain Python code to make a workable version of H-hat, as a rust/ folder will contain a respective Rust code. Each programming language development folder must reproduce the same results regardless the language chosen. It means different MDLs will converge on the expected behavior and a H-hat code should work in any of those implementations.

Current MDLs

Some MDLs are being actively developed and have their own branch. For example, development branch for Python MDL is in dev/python, while in progress branch should be in dev/python_impl/[custom_name]. Once stable, their folders should appear in the main branch.

How to use H-hat

Note

The development is still in alpha phase, but some features are being released in different MDLs to test concepts, functionalities, feasibility and performance.

Each MDL folder (for example python/) will contain more information about their implementation as well as how to install and/or start coding with H-hat. You may want to look directly into the folder of your preferred (available) programming language.

H-hat Heather

H-hat defines some rules and concepts to its paradigm so programmers can understand how to use it. However, it does not explicitly implement a particular syntax or interpreter/JIT/compiler. The main idea is to give programmers freedom to develop their own syntax and/or interpreter/compiler versions that are compatible with those rules.

To showcase some features and present programmers with its paradigm, a dialect is developed, called Heather. It is a simple dialect with simple syntax that can make concrete what programming a H-hat code should/does look like. You may find its implementation in some of the MDL folders as [MDL]/dialects/heather/ (ex: python/dialects/heather/).

New reference dialects may emerge in the future.

Getting Started

Finally, you can get started by checking out the Getting Started page.

License

MIT

How to Contribute

Check the How to Contribute page.

Code of Conduct

We coexist in the same world. So be nice to others as you expect others to be nice to you :)