Comments (6)
@rasa97 Thanks for the issue report! We just refactored the Deutsch-Josza module significantly. Would you mind looking at it again and see if this is still an issue?
from grove.
The refactored one works for single qubit. However, when I run the code for 2-qubits, there are errors. For balanced, I get:
The code is print dj.is_constant(qvm, {'00':'0', '01':'1', '10':'0', '11':'1'})
line 147, in unitary_function
value = int(mappings[bitstring])
KeyError: '0'
For constant, I get the error:
line 59, in is_constant
constant = all([bit == 0 for bit in bitstring])
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
The code is print dj.is_constant(qvm, {'00':'0', '01':'0', '10':'0', '11':'0'})
from grove.
@rasa97 Thank you for the followup! I'm opening up a PR to fix this!
from grove.
I'm curious to know why the inputs should be represented in a dict. Isn't list enough? Its easier that way, right?
from grove.
@rasa97 I agree that a list has less overhead, but it also makes implicit assumptions about ordering. Moreover, the structure of a dict
highlights the structure of the problem and makes it more apparent. In the end you will have to provide 2**n
inputs, so an additional factor of 2
will not make too much of a difference.
What's your thought on this?
from grove.
For the sake of convenience, list is better I guess. If the user has an idea about the ordering, it would be easier to just type in the bits. The pattern in which it should be typed can be highlighted in docs.
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.