Skip to content

Commit

Permalink
Updating main to version 0.2 (#75)
Browse files Browse the repository at this point in the history
* Backendbuddy (#60)

- agnostic_simulator source code now moved under qsdk submodule "backendbuddy"
- qsdk installation changed to reflect better these changes (simulators are now optional dependencies)
- Simulator class uses now a default simulator: qulacs if found, Cirq otherwise (Cirq always installed as a dependency with openfermion). This enables Mac users to be able to run tests properly, despite qulacs not installing for them.

* Backendbuddy qsdk examples moved (#62)
* agnostic simulator removed, top level of repo cleared (#65)
* qsdk reorg (helpers and "algorithms" folders), updated install (#69)
* Simplified the readme, added placeholder for citations and other upcoming things (#71)
* License: adding blob to all python files (#73)
* Forcing DMET energy to be real.
* Fixing verbose output for DMET and ONIOM get_resources method.
* minor-test-improvements (#70)


Co-authored-by: Valentin Senicourt <valentinsenicourt@Valentins-MacBook-Pro.local>
Co-authored-by: AlexandreF-1qbit <76115575+AlexandreF-1qbit@users.noreply.github.com>
Co-authored-by: JamesB-1qbit <84878946+JamesB-1qbit@users.noreply.github.com>
  • Loading branch information
4 people committed Oct 15, 2021
1 parent 85d84d1 commit 8768b8e
Show file tree
Hide file tree
Showing 252 changed files with 5,396 additions and 1,813 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/github_actions_automated_testing.yml
100644 → 100755
Expand Up @@ -24,15 +24,15 @@ jobs:
pip install pytest-cov
pip install jupyter
- name: Install backends except qsharp (see next section)
- name: Install backends except qsharp/qdk
run: |
pip install qiskit
pip install qulacs
pip install amazon-braket-sdk
pip install cirq
pip install projectq
- name: Microsoft qsharp
- name: Install Microsoft qsharp/qdk
run: |
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
Expand All @@ -42,26 +42,20 @@ jobs:
dotnet tool install -g Microsoft.Quantum.IQSharp
$(which dotnet-iqsharp) install --user
pip install qsharp
- name: agnostic_simulator install
run: |
cd agnostic_simulator
python setup.py install
- name: agnostic_simulator tests
run: |
cd agnostic_simulator
pytest tests --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
- name: qsdk install
run: |
pip install pyscf
cd qsdk
python setup.py install
if: always()

- name: qsdk tests
run: |
cd qsdk/qsdk
cd qsdk
pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
if: always()

- name: qsdk notebooks as tests
run: |
cd examples
pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html test_notebooks.py
if: always()
Empty file removed .gitmodules
Empty file.
1 change: 0 additions & 1 deletion Dockerfile

This file was deleted.

42 changes: 42 additions & 0 deletions Dockerfile
@@ -0,0 +1,42 @@
FROM fedora:30

RUN dnf -y update
RUN dnf -y install wget libgomp openblas-devel pandoc
RUN dnf clean all

# Python, C/C++ compilers, git
RUN dnf -y install gcc redhat-rpm-config gcc-c++ python3-devel make cmake git

# Set up a virtual environment, set all calls to pip3 and python3 to use it
RUN pip3 install virtualenv
ENV VIRTUAL_ENV=/root/env
RUN virtualenv -p python3 $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN ls -al /root/.bashrc
RUN more /root/.bashrc
RUN echo "export PATH=$PATH" >> /root/.bashrc

# Python packages for documentation, Jupyter notebook support and visualization
RUN pip3 install --upgrade pip
RUN pip3 install h5py==2.9.0 ipython jupyter setuptools wheel sphinx py3Dmol sphinx_rtd_theme nbsphinx scikit-build

# Copy and set root directory,
ENV PYTHONPATH=/root/qsdk:$PYTHONPATH
WORKDIR /root/
COPY . /root

# Install qSDK and its immediate dependencies (pyscf, openfermion, ...)
RUN python3 /root/setup.py install

# Install Microsoft QDK qsharp package
WORKDIR /tmp/
RUN dnf clean all
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc
RUN wget -q -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/30/prod.repo
RUN dnf install -y dotnet-sdk-3.1
RUN dotnet tool install -g Microsoft.Quantum.IQSharp
RUN /root/.dotnet/tools/dotnet-iqsharp install --user
RUN pip3 install qsharp

# Install other simulators
RUN pip install amazon-braket-sdk qiskit qulacs projectq
1 change: 0 additions & 1 deletion Jenkinsfile

This file was deleted.

14 changes: 14 additions & 0 deletions LICENSE
@@ -0,0 +1,14 @@
# Copyright 2021 1QB Information Technologies Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

111 changes: 92 additions & 19 deletions README.md
@@ -1,19 +1,92 @@
# QEMIST_qSDK contents

This repository contains two separate packages, called `qSDK` and `agnostic_simulator`.
Despite living in the same repository, these two packages are different entities. Their respective code, documentation,
tutorials, and installation instructions are contained in their own dedicated folder. Please refer to them.

- `qSDK` provides access to the tools developed for quantum chemistry simulation on quantum computers and emulators.
The package provides access to some problem decomposition techniques, electronic structure solvers, as well as the
various toolboxes containing the functionalities necessary to build these workflows, or your own.
It was developed to be compatible with QEMIST Cloud, to seamlessly enable the use of large scale problem decomposition
combined with both classical and quantum electronic structure solvers in the cloud. The package also provides local
problem decomposition techniques, and is designed to support the output of a problem decomposition method performed
through QEMIST Cloud as well.

- `agnostic_simulator` can be thought to be a quantum circuit simulation engine, allowing users to target a variety
of compute backends (QPUs and simulators) available on their local machine or through cloud services. In itself,
it has nothing to do with quantum chemistry, and thus has a wide range of applicability. `qSDK` relies on `agnostic_simulator`
for quantum circuit simulation, and requires that this package is installed.

# QEMIST_qSDK

Welcome !
This open-source quantum SDK provides tools developed for exploring quantum chemistry simulation end-to-end workflows on
both gate-model quantum computers and quantum circuit emulators.

It was designed to support the development of quantum algorithms and workflows running by providing building-blocks from various toolboxes.
It attempts to cover all steps of the process, such as quantum execution, pre- and post-processing techniques, including problem decomposition.
It provides users with features such as resource estimation, access to various compute backends (noiseless and noisy simulators,
quantum devices) and some classical solvers in order to keep track of both accuracy and resource requirements of our workflows,
and facilitate the design of successful hardware experiments.

## Install

This package requires a Python 3 environment.

We recommend:
- using [Python virtual environments](https://docs.python.org/3/tutorial/venv.html) in order to set up your environment safely and cleanly
- installing the "dev" version of Python3 if you encounter missing header errors such as `python.h file not found`.
- having good C/C++ compilers and BLAS library to ensure the quantum circuit simulators you choose to install have good performance.

### Using pip

TODO: once this package is available on pypi, give the command.

### From source, using setuptools

This package can be installed by first cloning this repository with `git clone`, and typing the following command in the
root directory:
```
python setup.py install
```

If the installation of a dependency fails and the reason is not obvious, we suggest installing that dependency
separately with `pip`, before trying again.

If you would like to modify or develop code in `qSDK`, you can add the path to this folder to your `PYTHONPATH`
environment variable instead of installing it with pip:
```
export PYTHONPATH=<path_to_this_folder>:$PYTHONPATH
```

### Optional dependencies

qSDK enables users to target various backends. In particular, it integrates quantum circuit simulators such as
`qulacs`, `qiskit`, `cirq` or `qdk`. We leave it to you to install the packages of your choice.
Backends such as `qulacs` and `cirq` show good overall performance. Most packages can be installed through pip in a straightforward way:
```
pip install qulacs
pip install qiskit
pip install cirq
...
```

Depending on your OS and environment, some of these packages may be more challenging to install. For installing Microsoft's QDK
or any issue regarding the above packages, please check their respective documentation.

### Optional: environment variables

Some environment variables can impact performance (ex: using GPU for quantum circuit simulation, or changing
the number of CPU threads used) or are used to connect to web services providing access to some compute backends.

See the list of relevant environment variables and their use in `env_var.sh`. In order for these variables to be set to
the desired values in your environment, you can run this shell script in Linux with the following command line:
`source env_var.sh` (you may need to set execution permissions with `chmod +x set_env_var.sh` first), or you can set
them in whatever way your OS supports it, or even inside your python script using the `os` package.

## Docs

TODO: insert sentence and link to sphinx documentation when its online.

## Tutorials

Please check the `examples` folder jupyter notebook tutorials and other examples.
TODO: recommend here the one we are doing about the DMET paper once its ready and merged

## Tests

Unit tests can be found in the `tests` folders, located in the various toolboxes they are related to. To automatically
find and run all tests (assuming you are in the `qsdk` subfolder that contains the code of the package):

```
python -m unittest
```

## Citations

If you use qSDK in your research, please cite

[TODO: this is a placeholder for our qSDK paper, to be written and put on arxiv in October]

Copyright 1QBit 2021. This software is released under the Apache Software License version 2.0.
2 changes: 1 addition & 1 deletion _config.yml
100644 → 100755
@@ -1 +1 @@
theme: jekyll-theme-cayman
theme: jekyll-theme-cayman
46 changes: 0 additions & 46 deletions agnostic_simulator/Dockerfile

This file was deleted.

Empty file removed agnostic_simulator/LICENSE
Empty file.
75 changes: 0 additions & 75 deletions agnostic_simulator/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions agnostic_simulator/agnostic_simulator/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions agnostic_simulator/agnostic_simulator/helpers/__init__.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions agnostic_simulator/agnostic_simulator/translator/__init__.py

This file was deleted.

6 changes: 0 additions & 6 deletions agnostic_simulator/cont_integration/run_test.sh

This file was deleted.

4 changes: 0 additions & 4 deletions agnostic_simulator/cont_integration/run_travis.sh

This file was deleted.

0 comments on commit 8768b8e

Please sign in to comment.