-
Notifications
You must be signed in to change notification settings - Fork 62
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
Cupy matrices #1558
Merged
Merged
Cupy matrices #1558
Changes from 32 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
295ccb1
fix: some fixes for cupy
BrunoLiegiBastonLiegi ce72115
fix: casting to numpy in optimizers
BrunoLiegiBastonLiegi 745f605
fix: specifying dtype
BrunoLiegiBastonLiegi dd70ea9
feat: playing around with the selfhosted workflow
BrunoLiegiBastonLiegi 1ed9f2b
feat: trying out numba threads fix
BrunoLiegiBastonLiegi 40c5b69
build: lock update
BrunoLiegiBastonLiegi b43767e
feat: update actions/upload-artifact
BrunoLiegiBastonLiegi 236fee7
feat: forcing numba threads to 1 in clifford backend
BrunoLiegiBastonLiegi 35cfeb7
Merge branch 'master' into selfhosted_workflow
BrunoLiegiBastonLiegi 6a4c31c
fix: removing explicit NUMBA_NUM_THREADS setting
BrunoLiegiBastonLiegi dcb9379
feat: restore original workflow
BrunoLiegiBastonLiegi 964a45f
feat: cupy fixes
BrunoLiegiBastonLiegi 1643a19
Merge branch 'cupy_matrices' into selfhosted_workflow
BrunoLiegiBastonLiegi b4c662a
Merge branch 'master' into cupy_matrices
BrunoLiegiBastonLiegi ec805dc
feat: added fixture for numba threads setting
BrunoLiegiBastonLiegi 6a7c610
Merge branch 'cupy_matrices' into selfhosted_workflow
BrunoLiegiBastonLiegi 5281a3a
build: updated qibojit dep
BrunoLiegiBastonLiegi 445013e
feat: removing manual thread setting
BrunoLiegiBastonLiegi 1e093f8
fix: import at top level
BrunoLiegiBastonLiegi 3bb38f9
Merge pull request #1561 from qiboteam/selfhosted_workflow
BrunoLiegiBastonLiegi a6e59bf
build: bump up cupy version
BrunoLiegiBastonLiegi e8f2397
refactor: Propagate qibojit changes in Qibo
andrea-pasquale e1a9243
test: Adapt list of backends for GPU
andrea-pasquale 73729c1
fix: Fixer for pytorch and qibojit-numba
andrea-pasquale d2ff7a6
fix: fixing some cuquantum tests
BrunoLiegiBastonLiegi 851cd1e
fix: some more test fixing
BrunoLiegiBastonLiegi c44a8ec
fix: further minor test fixes
BrunoLiegiBastonLiegi 2e465a4
Merge branch 'cupy_matrices' into fix_cuquantum
andrea-pasquale aab1d45
build: Update qibojit branch
andrea-pasquale bb9de64
fix: GST tests
andrea-pasquale e9ebc82
build: Revert branch to cupy_matrices
andrea-pasquale 48143d7
Merge pull request #1573 from qiboteam/fix_cuquantum
andrea-pasquale bed410f
fix: fixing BM20 and dropping support for AG04
BrunoLiegiBastonLiegi 75c85d2
fix: adding a no cover
BrunoLiegiBastonLiegi a1de6c0
build: Revert qibojit to main branch
andrea-pasquale bca0443
fix: moving the pragma to the right place
BrunoLiegiBastonLiegi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -216,8 +216,10 @@ def test_gate_tomography_noise_model(backend): | |||||||||||||||
) | ||||||||||||||||
@pytest.mark.parametrize("pauli_liouville", [False, True]) | ||||||||||||||||
def test_GST(backend, target_gates, pauli_liouville): | ||||||||||||||||
T = np.array([[1, 1, 1, 1], [0, 0, 1, 0], [0, 0, 0, 1], [1, -1, 0, 0]]) | ||||||||||||||||
T = backend.cast(T, dtype=T.dtype) | ||||||||||||||||
T = np.array( | ||||||||||||||||
[[1.0, 1, 1, 1], [0, 0, 1, 0], [0, 0, 0, 1], [1, -1, 0, 0]], dtype=np.complex128 | ||||||||||||||||
) | ||||||||||||||||
T = backend.cast(T) | ||||||||||||||||
Comment on lines
+219
to
+222
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
target_matrices = [g.matrix(backend=backend) for g in target_gates] | ||||||||||||||||
# superoperator representation of the target gates in the Pauli basis | ||||||||||||||||
target_matrices = [ | ||||||||||||||||
|
@@ -237,11 +239,11 @@ def test_GST(backend, target_gates, pauli_liouville): | |||||||||||||||
pauli_liouville=pauli_liouville, | ||||||||||||||||
backend=backend, | ||||||||||||||||
) | ||||||||||||||||
T_2q = np.kron(T, T) | ||||||||||||||||
T_2q = backend.np.kron(T, T) | ||||||||||||||||
for target, estimate in zip(target_matrices, approx_gates): | ||||||||||||||||
if not pauli_liouville: | ||||||||||||||||
G = empty_1q if estimate.shape[0] == 4 else empty_2q | ||||||||||||||||
G_inv = np.linalg.inv(G) | ||||||||||||||||
G_inv = backend.np.linalg.inv(G) | ||||||||||||||||
T_matrix = T if estimate.shape[0] == 4 else T_2q | ||||||||||||||||
estimate = T_matrix @ G_inv @ estimate @ G_inv | ||||||||||||||||
backend.assert_allclose( | ||||||||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.