Skip to main content

A Heuristic Algorithm Framework for Quantum Algorithms

Project description

HAQC -- Heuristic Algorithms for Quantum Computing Research Group

build

Research group to run optimisation algorithms on Quantum Computers at the University of Melbourne

Getting Started

Before getting started, ensure you have Python 3.7+. We use poetry to manage the python environment (the .gitignore file should already ignore it).

$ poetry install

To add a package to your new project:

$ poetry install <package>

This will automatically edit your pyproject.toml file with the new package you provided.

Next, activate the poetry shell:

$ poetry shell
$ python --version

This will spawn a new shell subprocess, which can be deactivated by using exit.

Contributing

Testing

For testing, we use pytest. To run the tests, just type the command pytest, or you can specify a file e.g. pytest tests/test_graph_generator.py.

We will use black as our code formatter. Simply run black -S . to run black over all the files before committing. The -S is to skip string normalisation, because we prefer single quotes/don't really care (flame war, I know).

Before making a PR

In summary, before merging a PR, you should:

# Make sure all tests pass
cd src
pipenv run python -m pytest tests/*

# Format with black
pipenv run python -m black -S .

MLFlow Tracking

To get the MLFlow tracking functionality to work you will need to setup awscli credentials, so MLFlow can properly log artifacts.

If you're keen to do this then please follow the instructions here

You can request the credentials for this experiment from Vivek at vkatial@student.unimelb.edu.au

Running a test instance

To run a test instance try out the steps below:

python qaoa_vrp/main.py -f test -T False # -T tracking for MLFlow

Jupyter Notebooks

First ensure that your Python is not aliased in your .bashrc or .zshrc file.

After this launch your poetry by

poetry shell

Then do:

python -m ipykernel install --user --name=ENV_NAME

Then launch the notebook

jupyter notebook

In your notebook, Kernel -> Change Kernel. Your kernel should now be an option.

Singularity

This project leverages Singularity to ensure the code is reproducible and manage dependencies.

You can find the recipe for our container in SingularityFile.def. There are various apps for each different type of experiment we run,

CI/CD

We use Github Actions for CI/CD. Everytime a PR is created, a test build of the singularity container runs. When merging into main we do a release of the container.

Authors

  • Vivek Katial

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

haqc-1.0.3.tar.gz (43.1 kB view hashes)

Uploaded Source

Built Distribution

haqc-1.0.3-py3-none-any.whl (60.5 kB view hashes)

Uploaded Python 3

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