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

Add support for specifiying the device that runcircuit is run on as well as the element type #282

Merged
merged 11 commits into from
Apr 15, 2022

Conversation

mtfishman
Copy link
Collaborator

The interface is:

using PastaQ
using ITensorGPU

runcircuit([("X", 1)]; device=cu, eltype=Float32)

Internally this transfers the starting state/process and circuit tensors to device and converts the element types of the starting state/process and circuit tensors to eltype.

This also work if you pass the gate tensors and state/process explicitly.

@mtfishman
Copy link
Collaborator Author

Hopefully fixes #274.

test/runtests.jl Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 15, 2022

Codecov Report

Merging #282 (2f498b1) into master (6d49251) will decrease coverage by 0.19%.
The diff coverage is 83.93%.

@@            Coverage Diff             @@
##           master     #282      +/-   ##
==========================================
- Coverage   87.57%   87.38%   -0.20%     
==========================================
  Files          22       22              
  Lines        2205     2298      +93     
==========================================
+ Hits         1931     2008      +77     
- Misses        274      290      +16     
Impacted Files Coverage Δ
src/io.jl 71.95% <0.00%> (ø)
src/measurements.jl 0.00% <ø> (ø)
src/tomography/tensornetwork-processtomography.jl 98.20% <ø> (ø)
src/circuits/trottersuzuki.jl 38.57% <39.02%> (-0.42%) ⬇️
src/itensor.jl 50.00% <40.00%> (+1.06%) ⬆️
src/circuits/gates.jl 78.00% <45.45%> (+0.91%) ⬆️
src/tomography/quantumtomography.jl 80.83% <71.42%> (-0.48%) ⬇️
src/circuits/getsamples.jl 86.11% <82.60%> (-0.94%) ⬇️
src/circuits/noise.jl 83.63% <83.33%> (-1.37%) ⬇️
src/utils.jl 76.74% <87.50%> (+0.32%) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d49251...2f498b1. Read the comment docs.

@mtfishman
Copy link
Collaborator Author

Ok this has been driving me nuts, but apparently if I run the test with the new tests I added ("test_gpu.jl") before I run some of the tests involving process tomography, the process tomography tests fail. I have no clue why that is happening...

If I run the process tomography tests in isolation locally, or run the "test_gpu.jl" tests after those tests, it all passes, so I think I will investigate that later and merge this.

@mtfishman mtfishman merged commit 5c3a23e into master Apr 15, 2022
@mtfishman mtfishman deleted the runcircuit_gpu branch April 15, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants