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

Customizing Clifford operations for qibojit engines #1150

Merged
merged 69 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
126c5cb
feat: adapted clifford operations to work with njit
BrunoLiegiBastonLiegi Dec 11, 2023
3cd3735
feat: refactor of clifford operations + minor perf improvements
BrunoLiegiBastonLiegi Dec 18, 2023
6547f0b
fix: changed dtype in M for numba signature compatibility
BrunoLiegiBastonLiegi Dec 19, 2023
4c885ed
feat: separated clifford operations
BrunoLiegiBastonLiegi Dec 22, 2023
a5c746a
feat: created helper functions for M
BrunoLiegiBastonLiegi Dec 22, 2023
5c636e9
fix: reintroduced get_rxz
BrunoLiegiBastonLiegi Dec 27, 2023
d587418
fix: removed print and unnecessary files
BrunoLiegiBastonLiegi Dec 27, 2023
d839db0
feat: minor modifications + removed the CliffordOperations object
BrunoLiegiBastonLiegi Jan 10, 2024
547cd85
fix: small fix to test_set_backend
BrunoLiegiBastonLiegi Jan 10, 2024
b1462ff
Merge branch 'master' into clifford_simulator_numba
BrunoLiegiBastonLiegi Jan 10, 2024
f87735c
feat: implemented reshape_clifford_state for cupy compatibility
BrunoLiegiBastonLiegi Jan 12, 2024
895cf1a
Merge branch 'master' into clifford_simulator_numba
BrunoLiegiBastonLiegi Jan 12, 2024
491bc07
fix: small fix to execute circuit
BrunoLiegiBastonLiegi Jan 12, 2024
e5e0a6a
fix: minor fix to sample_shots for cupy compatibility
BrunoLiegiBastonLiegi Jan 17, 2024
dc15f7d
fix: added dtype to cast
BrunoLiegiBastonLiegi Jan 17, 2024
49d47cf
fix: minor modifications to rowsum and M
BrunoLiegiBastonLiegi Jan 17, 2024
df05505
fix: minor fixes to measurements
BrunoLiegiBastonLiegi Jan 18, 2024
6aeb3dc
fix: got rid of the loop in determined outcome
BrunoLiegiBastonLiegi Jan 26, 2024
18246ac
Merge branch 'master' into clifford_simulator_numba
renatomello Jan 29, 2024
cf6246d
fix: small fix to random and determined outcome
BrunoLiegiBastonLiegi Jan 30, 2024
534377d
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 2, 2024
a671f6e
fix: small fix to samples_to_decimal
BrunoLiegiBastonLiegi Feb 5, 2024
42b4bce
Merge branch 'master' into clifford_simulator_numba
BrunoLiegiBastonLiegi Feb 5, 2024
fcd4fc1
fix: review updates
BrunoLiegiBastonLiegi Feb 7, 2024
058840d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 7, 2024
97c4ce8
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 7, 2024
63d0e7b
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 7, 2024
7308b77
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 7, 2024
0df677b
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 7, 2024
220768f
fix: returning exp directly
BrunoLiegiBastonLiegi Feb 7, 2024
6013e4e
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 8, 2024
16592a6
Merge branch 'clifford_simulator_numba' of github.com:qiboteam/qibo i…
renatomello Feb 8, 2024
9d15645
refactor: passing state[:-1]
BrunoLiegiBastonLiegi Feb 8, 2024
35fed66
Update src/qibo/backends/_clifford_operations.py
BrunoLiegiBastonLiegi Feb 12, 2024
98cd276
Update src/qibo/backends/_clifford_operations.py
BrunoLiegiBastonLiegi Feb 12, 2024
b3e839e
refactor: update _exponent
BrunoLiegiBastonLiegi Feb 12, 2024
0eb7335
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 14, 2024
1925317
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 14, 2024
1502f34
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 16, 2024
1eb4aba
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 16, 2024
54bac98
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 16, 2024
47815f1
refactor: moved clifford operations out of the standard backends
BrunoLiegiBastonLiegi Feb 16, 2024
3ed4b0b
Delete src/qibo/backends/#__init__.py#
BrunoLiegiBastonLiegi Feb 16, 2024
da1d351
`pylint` suggestions
renatomello Feb 19, 2024
b2f5673
Update src/qibo/backends/clifford.py
renatomello Feb 19, 2024
5f6e614
fix: fix circular import in clifford.py
BrunoLiegiBastonLiegi Feb 19, 2024
0a50391
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 19, 2024
d160d14
fix: fix to frequencies and repeated execution + rolled back to old o…
BrunoLiegiBastonLiegi Feb 20, 2024
1d9f7c0
build: updated pyproject.toml
BrunoLiegiBastonLiegi Feb 20, 2024
687763d
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 20, 2024
23e0736
feat: added platform attr to clifford backend
BrunoLiegiBastonLiegi Feb 20, 2024
29e2e1a
Delete tests/#test_dill.py#
BrunoLiegiBastonLiegi Feb 20, 2024
2be7d1d
Delete tests/.#test_dill.py
BrunoLiegiBastonLiegi Feb 20, 2024
757fc68
build: update lock
BrunoLiegiBastonLiegi Feb 21, 2024
96fd929
feat: promoted _get_engine function to a clifford module function
BrunoLiegiBastonLiegi Feb 21, 2024
0d4bbbd
test: missing _get_engine instance in test
BrunoLiegiBastonLiegi Feb 21, 2024
607567d
build: update lock
BrunoLiegiBastonLiegi Feb 21, 2024
83f952b
build: update lock
BrunoLiegiBastonLiegi Feb 21, 2024
7478bb4
fix: fixed doctests
BrunoLiegiBastonLiegi Feb 21, 2024
ae4bfce
cov:
BrunoLiegiBastonLiegi Feb 21, 2024
0a599d9
cov: ignoring two lines for coverage
BrunoLiegiBastonLiegi Feb 22, 2024
7ddb8a4
fix: removed useless vstack
BrunoLiegiBastonLiegi Feb 22, 2024
7ae1e11
refactor: removed name from engines
BrunoLiegiBastonLiegi Feb 23, 2024
a81d273
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 26, 2024
4591bc7
Merge branch 'master' into clifford_simulator_numba
renatomello Feb 27, 2024
f1d4528
build: pointing again at qibojit main
BrunoLiegiBastonLiegi Feb 28, 2024
60c4d16
build: poetry lock no update
BrunoLiegiBastonLiegi Feb 28, 2024
efd49f5
build: lock update
BrunoLiegiBastonLiegi Feb 29, 2024
6c58874
build: Add upper bounds to TensorFlow version
alecandido Feb 29, 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
6 changes: 3 additions & 3 deletions doc/source/api-reference/qibo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1592,12 +1592,12 @@ passing a symplectic matrix to the constructor.
.. testsetup::

from qibo.quantum_info import Clifford
from qibo.backends import CliffordBackend, NumpyBackend
from qibo.backends import CliffordBackend

# construct the |00...0> state
backend = CliffordBackend(NumpyBackend())
backend = CliffordBackend("numpy")
symplectic_matrix = backend.zero_state(nqubits=3)
clifford = Clifford(symplectic_matrix, engine=NumpyBackend())
clifford = Clifford(symplectic_matrix, engine="numpy")

The generators of the stabilizers can be extracted with the
:meth:`qibo.quantum_info.clifford.Clifford.generators` method,
Expand Down
214 changes: 103 additions & 111 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dill = "^0.3.6"
pytest-cov = "^4.0.0"
pylint = "^3.0.3"
matplotlib = "^3.7.0"
qibojit = { git = "https://github.com/qiboteam/qibojit.git" }
qibojit = { git = "https://github.com/qiboteam/qibojit.git", branch = "clifford_simulator_numba" }
tensorflow = { version = "^2.14.1", markers = "sys_platform == 'linux'" }

[tool.poe.tasks]
Expand All @@ -83,15 +83,15 @@ optional = true
[tool.poetry.group.cuda11.dependencies]
cupy-cuda11x = "^12.0.0"
cuquantum-python-cu11 = "^23.3.0"
qibojit = { git = "https://github.com/qiboteam/qibojit.git" }
qibojit = { git = "https://github.com/qiboteam/qibojit.git", branch = "clifford_simulator_numba" }

[tool.poetry.group.cuda12]
optional = true

[tool.poetry.group.cuda12.dependencies]
cupy-cuda12x = "^12.0.0"
cuquantum-python-cu12 = "^23.3.0"
qibojit = { git = "https://github.com/qiboteam/qibojit.git" }
qibojit = { git = "https://github.com/qiboteam/qibojit.git", branch = "clifford_simulator_numba" }

[tool.pylint.reports]
output-format = "colorized"
Expand Down
5 changes: 0 additions & 5 deletions src/qibo/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ def construct_backend(backend, platform=None):

return QibolabBackend(platform)
elif backend == "clifford":
if platform is not None: # pragma: no cover
if platform in ("cupy", "numba", "cuquantum"):
platform = construct_backend("qibojit", platform=platform)
else:
platform = construct_backend(platform)
return CliffordBackend(platform)

else: # pragma: no cover
Expand Down
Loading
Loading