Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #197

Merged
merged 143 commits into from
Feb 21, 2024
Merged

Dev #197

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
4bf8411
added docstrings
denvitko Jun 13, 2023
3610ea5
added docstrings
denvitko Jun 13, 2023
13c77c9
added a few docstrings
denvitko Jun 13, 2023
0c3deff
Update deprecated torch.range and torch.outer
kit1980 Jul 19, 2023
c1efb86
separated hadamard from rest
01110011011101010110010001101111 Aug 30, 2023
61628a1
updated operators for the new dev
01110011011101010110010001101111 Aug 30, 2023
857268e
Merge branch 'dev' into reformatting_ops
01110011011101010110010001101111 Aug 30, 2023
2063965
Merge pull request #1 from GenericP3rson/reformatting_ops
01110011011101010110010001101111 Aug 30, 2023
7025a07
separate file for x, y, z, i, s, t, and sx gates
01110011011101010110010001101111 Aug 31, 2023
dbcfea4
reformatting operations into separate files
01110011011101010110010001101111 Aug 31, 2023
1551eeb
added u gate alias and merged u and u3 files
01110011011101010110010001101111 Aug 31, 2023
9712d44
Merge pull request #2 from GenericP3rson/reformatting_ops
01110011011101010110010001101111 Aug 31, 2023
fedd224
adding automatic pytest checks
01110011011101010110010001101111 Aug 31, 2023
8db6add
[minor] fix nonexistent variables
01110011011101010110010001101111 Aug 31, 2023
5084dcb
[minor] fix density_func indentation
01110011011101010110010001101111 Aug 31, 2023
c0af684
add dependencies to test and add skip marker
01110011011101010110010001101111 Sep 1, 2023
f2c021c
Merge pull request #3 from GenericP3rson/dev_updated
01110011011101010110010001101111 Sep 2, 2023
46c65bd
[minor] update qiskit
01110011011101010110010001101111 Sep 2, 2023
ac868ab
[minor] update qiskit
01110011011101010110010001101111 Sep 2, 2023
8db9260
Merge pull request #190 from GenericP3rson/complete_actions
Hanrui-Wang Sep 2, 2023
744b49a
fix: make the parameter shift example compatible with latest torchqua…
Zhaoyilunnn Sep 12, 2023
566e1ff
structure reformatting of operations — passing tests
01110011011101010110010001101111 Sep 15, 2023
7ac5fa3
Merge branch 'dev' into dev
01110011011101010110010001101111 Sep 15, 2023
15502ea
[minor] added all aliases
01110011011101010110010001101111 Sep 15, 2023
c893f23
moved param_ops and fixed_ops to be automatically generated
01110011011101010110010001101111 Sep 15, 2023
c99b0af
Merge pull request #192 from Zhaoyilunnn/main
Hanrui-Wang Sep 20, 2023
a24f0cf
adding support for generalr/rx/ry
01110011011101010110010001101111 Oct 14, 2023
00f6775
broke nlocal into separate files
01110011011101010110010001101111 Oct 14, 2023
dd3fc64
Merge pull request #187 from GenericP3rson/dev
Hanrui-Wang Oct 15, 2023
c9929e0
[minor] add a simplied version of quantumnas
Hanrui-Wang Oct 15, 2023
d2d8b79
Merge branch 'dev' of https://github.com/mit-han-lab/torchquantum int…
Hanrui-Wang Oct 15, 2023
e815341
add layers to docs
01110011011101010110010001101111 Oct 15, 2023
09a9afe
[minor] update operator path
01110011011101010110010001101111 Oct 15, 2023
a532575
running example to test functionality
01110011011101010110010001101111 Oct 15, 2023
1d7fece
fixing attempt
01110011011101010110010001101111 Oct 15, 2023
c6019f8
Fixes bug with importing transpiled circuits which are mapped naively…
Vivekyy Oct 17, 2023
2bffd4f
Merge pull request #205 from GenericP3rson/docs_update
Hanrui-Wang Oct 20, 2023
07c3dd3
Merge pull request #208 from Vivekyy/layout_bug_fix
Hanrui-Wang Oct 20, 2023
9f38792
[minor] cleaned unused imports and specified imported variables
01110011011101010110010001101111 Oct 21, 2023
c11b124
[minor] add qubit rotation tutorial
01110011011101010110010001101111 Oct 21, 2023
05baedb
Merge pull request #209 from GenericP3rson/GenericP3rson-patch-1
Hanrui-Wang Oct 22, 2023
5ddd723
Merge pull request #169 from kit1980/main
Oct 22, 2023
e609afd
Update README.md
Hanrui-Wang Oct 28, 2023
7af4f49
adding entangle layers
01110011011101010110010001101111 Nov 3, 2023
3b0bdaf
running style updates on layers
01110011011101010110010001101111 Nov 3, 2023
c425201
added more general entanglement class
01110011011101010110010001101111 Nov 3, 2023
a95e842
[minor] updating isometry import
01110011011101010110010001101111 Nov 4, 2023
d1b6a90
[minor] update to be compatible with documentation
01110011011101010110010001101111 Nov 4, 2023
5a1d4d7
[minor] entanglement_type -> entanglement
01110011011101010110010001101111 Nov 4, 2023
0c81b4d
Merge pull request #212 from GenericP3rson/minor_doc_updates
Hanrui-Wang Nov 4, 2023
357dc4d
Merge pull request #211 from GenericP3rson/entangle_layers
Hanrui-Wang Nov 4, 2023
f53bb6c
preliminary twolocal test for similar structure
01110011011101010110010001101111 Nov 11, 2023
b491259
[minor] resolving missing import
01110011011101010110010001101111 Nov 11, 2023
ff10729
adding tests for other nlocal circuits
01110011011101010110010001101111 Nov 12, 2023
43109a9
fixed aliasing issue and added tests
01110011011101010110010001101111 Nov 18, 2023
9e20154
[minor] import fix
01110011011101010110010001101111 Nov 18, 2023
46b04ca
adding GRZ gate
01110011011101010110010001101111 Nov 18, 2023
2988f27
Merge pull request #201 from GenericP3rson/generalr
Hanrui-Wang Nov 20, 2023
9312337
added tests and slight modification to rotation
01110011011101010110010001101111 Nov 24, 2023
beef182
[minor] fix path to h2.txt file for vqe
01110011011101010110010001101111 Nov 24, 2023
12a552a
[minor] updated to fully handle not having qiskit
01110011011101010110010001101111 Nov 24, 2023
4565221
[minor] added a missing layer
01110011011101010110010001101111 Nov 24, 2023
83345b4
[minor] fixed grover example dependency
01110011011101010110010001101111 Nov 24, 2023
1637680
[minor] adding imports for pulse
01110011011101010110010001101111 Nov 24, 2023
60b055f
[minor] fixed typo in save_load
01110011011101010110010001101111 Nov 24, 2023
52391de
[minor] added test + fixed layer import
01110011011101010110010001101111 Nov 24, 2023
2da85e5
updates to paulitwodesign, structure of twolocal circuits, and tests …
01110011011101010110010001101111 Nov 25, 2023
e5cdd52
removing extraneous file
01110011011101010110010001101111 Nov 25, 2023
33bfb85
[minor] style update
01110011011101010110010001101111 Nov 25, 2023
53ed825
Merge branch 'dev' into more_gh_actions_test
01110011011101010110010001101111 Nov 25, 2023
5b63a97
[minor] fix README
01110011011101010110010001101111 Nov 25, 2023
19762fa
reformatted hadamard for functionals
01110011011101010110010001101111 Dec 2, 2023
15bfb8c
moved the test locations
01110011011101010110010001101111 Dec 2, 2023
34b974c
Merge branch 'gh_test' into dev
01110011011101010110010001101111 Dec 2, 2023
179cf79
Merge pull request #4 from GenericP3rson/dev
01110011011101010110010001101111 Dec 2, 2023
a725b11
Merge branch 'more_gh_actions_test' into gh_test
01110011011101010110010001101111 Dec 2, 2023
43b4712
Merge pull request #5 from GenericP3rson/gh_test
01110011011101010110010001101111 Dec 2, 2023
e22c64e
[minor] removed unnecessary tests and added tests for python 3.12
01110011011101010110010001101111 Dec 2, 2023
09e95aa
Merge pull request #202 from GenericP3rson/n_local_mod_structure
Hanrui-Wang Dec 11, 2023
7747260
Merge pull request #215 from mit-han-lab/GenericP3rson-patch-1
Hanrui-Wang Dec 11, 2023
56f29ad
minor reformatting of the layers
01110011011101010110010001101111 Dec 23, 2023
679f797
light general gates reformatting
01110011011101010110010001101111 Dec 23, 2023
af575f4
separated entanglement into separate folder and started separating th…
01110011011101010110010001101111 Dec 23, 2023
56ef548
[minor] bugfix: rm unused variable in __all__
01110011011101010110010001101111 Dec 23, 2023
0fad677
completed inital layer break up
01110011011101010110010001101111 Dec 23, 2023
8aa995a
[minor] add full entanglement path
01110011011101010110010001101111 Dec 23, 2023
4bd7e7c
[minor] added parameters for quanvolution and qlstm
01110011011101010110010001101111 Dec 24, 2023
e4ad65d
[minor] update typo
01110011011101010110010001101111 Dec 24, 2023
64f8d20
[minor] add tests for optimal_control, qaoa, mnist
01110011011101010110010001101111 Dec 25, 2023
e436a79
Merge pull request #6 from GenericP3rson/dev
01110011011101010110010001101111 Dec 29, 2023
cd0cff6
[major] reformatting functionals
01110011011101010110010001101111 Dec 29, 2023
be369f0
Fix some bug in density matrix calculation
Jan 13, 2024
78a16d7
The bell example of density matrix multiplication is correct.
Jan 20, 2024
80fb7a6
Merge pull request #216 from GenericP3rson/functional_reformatting
Hanrui-Wang Jan 20, 2024
981a523
Merge pull request #218 from GenericP3rson/reformat_layers
Hanrui-Wang Jan 20, 2024
e81bb81
Add noisedevices class.
Jan 20, 2024
ac02491
Remove redudant code in the density matrix calculation.
Jan 20, 2024
4739d75
running example to test functionality
01110011011101010110010001101111 Oct 15, 2023
0db9cc9
fixing attempt
01110011011101010110010001101111 Oct 15, 2023
ac4853e
added tests and slight modification to rotation
01110011011101010110010001101111 Nov 24, 2023
ae4f37c
[minor] fix path to h2.txt file for vqe
01110011011101010110010001101111 Nov 24, 2023
2ee23f6
[minor] updated to fully handle not having qiskit
01110011011101010110010001101111 Nov 24, 2023
ec92f93
[minor] added a missing layer
01110011011101010110010001101111 Nov 24, 2023
21fbe08
[minor] fixed grover example dependency
01110011011101010110010001101111 Nov 24, 2023
4d7417c
[minor] adding imports for pulse
01110011011101010110010001101111 Nov 24, 2023
7d72ff3
[minor] fixed typo in save_load
01110011011101010110010001101111 Nov 24, 2023
49c13a6
[minor] added test + fixed layer import
01110011011101010110010001101111 Nov 24, 2023
9d6fae4
moved the test locations
01110011011101010110010001101111 Dec 2, 2023
d135c4b
[minor] removed unnecessary tests and added tests for python 3.12
01110011011101010110010001101111 Dec 2, 2023
26f4040
[minor] added parameters for quanvolution and qlstm
01110011011101010110010001101111 Dec 24, 2023
66a7fc0
[minor] update typo
01110011011101010110010001101111 Dec 24, 2023
16b7d06
[minor] add tests for optimal_control, qaoa, mnist
01110011011101010110010001101111 Dec 25, 2023
43c2a2c
[minor] rm layers.py to resolve merge conflict
01110011011101010110010001101111 Jan 20, 2024
975c59f
Merge pull request #7 from GenericP3rson/dev
01110011011101010110010001101111 Jan 20, 2024
35f1a0e
[minor] bug fix for seth layer
01110011011101010110010001101111 Jan 20, 2024
ffaaefa
[minor] bugfix for sx
01110011011101010110010001101111 Jan 20, 2024
d95c0ed
Implement noisedevice.
Jan 20, 2024
045a289
Merge branch 'dev' of https://github.com/mit-han-lab/torchquantum int…
Jan 20, 2024
a9c13da
[minor] u3 layer bugfix
01110011011101010110010001101111 Jan 20, 2024
3ac389f
Add an example of running circuit on density device.
Jan 20, 2024
1deef48
[minor] add an example of cuquantum
Hanrui-Wang Jun 3, 2023
915491f
[minor] update ibm util
Hanrui-Wang Jun 3, 2023
c34a5e8
[minor] merged pr for more docstrings
01110011011101010110010001101111 Jan 27, 2024
958e41f
[minor] rm rebase bug
01110011011101010110010001101111 Jan 27, 2024
c9ed61f
[minor] rm init to get tests working
01110011011101010110010001101111 Jan 28, 2024
2c3a6f8
[minor] changing the way pytest is run to try to change the error
01110011011101010110010001101111 Jan 28, 2024
75bd6ce
[minor] readding init to try to fix the tests
01110011011101010110010001101111 Jan 29, 2024
12b67b8
Merge pull request #224 from GenericP3rson/fix_test
01110011011101010110010001101111 Jan 29, 2024
8254fd1
[minor] update OneQubitEulerDecomposer
01110011011101010110010001101111 Feb 11, 2024
78debc5
Merge branch 'test_branch' into fix_test
01110011011101010110010001101111 Feb 18, 2024
fc3d560
Merge pull request #12 from GenericP3rson/fix_test
01110011011101010110010001101111 Feb 18, 2024
2ff1645
Merge pull request #13 from mit-han-lab/dev
01110011011101010110010001101111 Feb 18, 2024
0f64867
[minor] lower the qiskit version
01110011011101010110010001101111 Feb 18, 2024
0b00979
[major] removed deprecated IBMQ dependency and restricted to qiskit<1…
01110011011101010110010001101111 Feb 21, 2024
b985192
[minor] added missing dependency
01110011011101010110010001101111 Feb 21, 2024
1f7bcf0
[minor] flipping order of imports
01110011011101010110010001101111 Feb 21, 2024
d6fffa1
[minor] updating the requirements
01110011011101010110010001101111 Feb 21, 2024
e4233ff
Merge pull request #14 from mit-han-lab/tq_bugfix
01110011011101010110010001101111 Feb 21, 2024
5294366
[major] update documentation deployment
01110011011101010110010001101111 Feb 21, 2024
269e0f2
Merge pull request #239 from mit-han-lab/tq_bugfix
01110011011101010110010001101111 Feb 21, 2024
8f3421b
[minor] adding the missing dependency
01110011011101010110010001101111 Feb 21, 2024
fefb10b
Merge pull request #238 from mit-han-lab/docs_ii
Hanrui-Wang Feb 21, 2024
497320c
Merge pull request #236 from GenericP3rson/test_branch
Hanrui-Wang Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/functional_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
pull_request:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install flake8 pytest qiskit-aer qiskit_ibm_runtime
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -m pytest -m "not skip"
- name: Install TorchQuantum
run: |
pip install --editable .
- name: Test Examples
run: |
python3 examples/qubit_rotation/qubit_rotation.py --epochs 1
python3 examples/vqe/vqe.py --epochs 1 --steps_per_epoch 1
python3 examples/train_unitary_prep/train_unitary_prep.py --epochs 1
python3 examples/train_state_prep/train_state_prep.py --epochs 1
python3 examples/superdense_coding/superdense_coding_torchquantum.py
python3 examples/regression/run_regression.py --epochs 1
python3 examples/param_shift_onchip_training/param_shift.py
python3 examples/mnist/mnist_2qubit_4class.py --epochs 1
python3 examples/hadamard_grad/circ.py
python3 examples/encoder_examples/encoder_8x2ry.py
python3 examples/converter_tq_qiskit/convert.py
python3 examples/amplitude_encoding_mnist/mnist_new.py --epochs 1
python3 examples/amplitude_encoding_mnist/mnist_example.py --epochs 1
python3 examples/PauliSumOp/pauli_sum_op.py
python3 examples/regression/new_run_regression.py --epochs 1
python3 examples/quanvolution/quanvolution_trainable_quantum_layer.py --epochs 1
python3 examples/grover/grover_example_sudoku.py
python3 examples/param_shift_onchip_training/param_shift.py
python3 examples/quanvolution/quanvolution.py --epochs 1
python3 examples/quantum_lstm/qlstm.py --epochs 1
python3 examples/qaoa/max_cut_backprop.py --steps 1
python3 examples/optimal_control/optimal_control.py --epochs 1
python3 examples/optimal_control/optimal_control_gaussian.py --epochs 1
python3 examples/optimal_control/optimal_control_multi_qubit.py --epochs 1
python3 examples/save_load_example/save_load.py
python3 examples/mnist/mnist.py --epochs 1
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@


<p align="center">
<a href="https://github.com/mit-han-lab/torchquantum/blob/master/LICENSE">
<img alt="MIT License" src="https://img.shields.io/github/license/mit-han-lab/torchquantum">
</a>
<a href="https://torchquantum.readthedocs.io/">
<img alt="Documentation" src="https://img.shields.io/readthedocs/torchquantum/main">
</a>
<a href="https://github.com/mit-han-lab/torchquantum/blob/master/LICENSE">
<img alt="MIT License" src="https://img.shields.io/github/license/mit-han-lab/torchquantum">
</a>
<a href="https://join.slack.com/t/torchquantum/shared_invite/zt-1ghuf283a-OtP4mCPJREd~367VX~TaQQ">
<img alt="Chat @ Slack" src="https://img.shields.io/badge/slack-chat-2eb67d.svg?logo=slack">
</a>
Expand All @@ -25,7 +25,6 @@
<a href="https://qmlsys.mit.edu">
<img alt="Website" src="https://img.shields.io/website?up_message=qmlsys&url=https%3A%2F%2Fqmlsys.mit.edu">
</a>

<a href="https://pypi.org/project/torchquantum/">
<img alt="Pypi" src="https://img.shields.io/pypi/v/torchquantum">
</a>
Expand Down
7 changes: 7 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
furo @ git+https://github.com/frogcjn/torchquantum-doc-furo-theme.git
nbsphinx
recommonmark

torchquantum>=0.1
opt_einsum
qiskit_ibm_runtime
29 changes: 29 additions & 0 deletions docs/source/api_layers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
torchquantum.layers
======================

.. currentmodule:: torchquantum.layer

Layers
---------
.. autosummary::
:toctree: generated
:template: classtemplate_controlflow.rst


QuantumModuleFromOps
TrainableOpAll
ClassicalInOpAll
FixedOpAll
TwoQAll
RandomLayer
RandomLayerAllTypes
Op1QAllLayer
RandomOp1All
Op2QAllLayer
Op2QButterflyLayer
Op2QDenseLayer
CXLayer
CXCXCXLayer
SWAPSWAPLayer
RXYZCXLayer0
QFTLayer
2 changes: 1 addition & 1 deletion docs/source/api_operators.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
torchquantum.operators
======================

.. currentmodule:: torchquantum.operators
.. currentmodule:: torchquantum.operator

Classes
---------
Expand Down
3 changes: 1 addition & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import sys
import os
sys.path.insert(0, os.path.abspath('../..'))
import furo

#import pathlib
#sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix())
Expand Down Expand Up @@ -160,4 +159,4 @@
display_gitlab = False
show_source = True
# -- Options for EPUB output
epub_show_urls = 'footnote'
epub_show_urls = 'footnote'
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
api_torchquantum
api_functional
api_operators
api_layers

.. toctree::
:maxdepth: 1
Expand Down
Loading
Loading