Comments (8)
The representation is as a binary fraction listed from the right. This means that
0001 represents 1/2
0010 represents 1/4
0011 represents 1/4 + 1/2 = 3/4
1000 represents 1/16
Each index to the left is 1/2^i
Does that makes sense @peterwittek ?
from grove.
I think there are two issues here, one is related to #44 and the other is some change to pyquil between late November and now. I'm trying to find the pyquil commit causing the problem.
from grove.
Thanks @kmckiern ! This appears to be fixed.
from grove.
@JansenZhao thanks for raising the issue. That is concerning. I wonder if this is related to issue #44?
from grove.
@ncrubin Thanks. Most likely, but I am not so clear what was meant by "What phase convention did we choose so the QFT is correct?" in #44.
from grove.
I've taken a bit of a look into this and also think that we need to confirm the convention.
When I run the following:
import numpy as np
import scipy.linalg
from grove.alpha.phaseestimation.phase_estimation import phase_estimation
import pyquil.api as api
qvm = api.QVMConnection()
phase = 3/4
Z = np.asarray([[1.0, 0.0], [0.0, -1.0]])
Rz = scipy.linalg.expm(1j*Z*2*np.pi*phase)
p = phase_estimation(Rz, 8)
print(qvm.run(p, range(8), 1))
print(qvm.wavefunction(p))
I get this output:
[[0, 0, 0, 0, 0, 0, 1, 0]]
(1+0j)|001000000>
I would expect
[[0, 0, 0, 0, 0, 0, 1, 1]]
(1+0j)|110000000>
In general if I run with phase of x
then I seem to get a bit representation of 1-x
and the wavefunction is shifted to the right by one qubit from what i would expect
e.g. for phase=1/16
I get:
[[0, 0, 0, 0, 1, 1, 1, 1]]
(1+0j)|011110000>
from grove.
I'm also getting non-deterministic results for phase=1/8
. I would expect that because 1/8 can be exactly represented as a binary fraction then it should give exact and deterministic results? @ncrubin ?
from grove.
Thanks, it works fine! What's the convention for the binary encoding of the phase?
from grove.
Related Issues (20)
- Add type annotations to grove modules
- Make grove documentation pyQuil 2.0 compatible
- Make VQE/QAOA/ising modules pyQuil 2.0 compatible
- Make example notebooks pyQuil 2.0 compatible
- DeutschJosza has no business being a class
- IsingSolver probably doesn't work with noise models
- Inconsistent energy in maxcut_qaoa depending on samples argument
- Implementation of weighted Max-cut
- Bug when minimizer_kwargs is empty but the minimizer is not optimize.minimize
- Bug in vqe_run when disp = True
- 'QVMConnection' object has no attribute 'run_and_measure_async'
- master/docs/qaoa.rst is almost unintelligible because markup is not rendered HOT 4
- VQE documentation is out of date with code HOT 1
- Release 1.8.0 (or 2.0.0).
- Phase Estimation wont return eigenvectors that correspond to the eigenvalue
- maxcut notebook is broke HOT 1
- Problem with the 'return_all' parameter in the 'vqe_run'
- import error 'get_devices' HOT 1
- VQE on QVM with noise model not compatible
- Numpy required for setup?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grove.