Comments (5)
Can you test if with this change in json_to_op_bfunc
in operations.hpp
fixes it?
JSON::get_value(op.memory, "memory", js);
JSON::get_value(op.registers, "register", js);
to
uint_t tmp;
if (JSON::get_value(tmp, "register", js)) {
op.registers.push_back(tmp);
}
if (JSON::get_value(tmp, "memory", js)) {
op.memory.push_back(tmp);
}
NB: Do we actually need the "memory"
part for bfunc? If only register used by the spec then the last part can just be removed.
from qiskit-aer.
That gets it past the JSON validation failure and the simulation completes, but the counts returned aren't what I wouldn't expect.
For the circuit above:
┌───┐┌─┐
q1_0: |0>┤ H ├┤M├──────────
└───┘└╥┘┌─────┐┌─┐
q1_1: |0>──────╫─┤ X ├┤M├
║ ├──┴──┤└╥┘
c2_0: 0 ══════╩═╡ = 1 ╞═╬═
└─────┘ ║
c3_0: 0 ════════════════╩═
I get (with qobj-conditionals from terra and the fix above):
{'0 0': 513, '0 1': 511}
With old-style conditionals from terra and master aer I get:
{'0 0': 519, '1 1': 505}
Looking briefly, it looks like apply_bfunc
is making the right comparison, but its result is not being written to the provided register. (I'm not at all familiar with the simulator code, but it looks like apply_bfunc
is returning the boolean result of the comparison, but State::apply_ops
is not getting that return value written to the register.)
Re: "memory"
, the spec lists it as "(optional): Memory slot in which to store the boolean function result" presumably for debugging.
from qiskit-aer.
@kdk ok thanks for looking into it. I've tried fixing it in PR #55 if you want to test it.
Note: there might still be bugs in the actual logic of the bfunc function since it hasn't really well tested.
from qiskit-aer.
👍 Awesome, tested on #55 and it looks good. Thanks!
from qiskit-aer.
Closed by #55
from qiskit-aer.
Related Issues (20)
- Aer `0.13.3` fails to install HOT 2
- MPS reports incorrect required memory HOT 1
- Supported number of qubits are not increasing with multiple nodes HOT 1
- Aer not getting imported. HOT 2
- ImportError: cannot import name 'Aer' from 'qiskit' (C:\Users\sandi\anaconda3\Lib\site-packages\qiskit\__init__.py) HOT 1
- Deprecate Qobj
- Deprecate standalone
- 'Aer' is not defined HOT 4
- Not able to load IBMQ HOT 1
- How to get the result of job
- Calling AerState amplitude (also probability) is slow HOT 3
- CostBasedFusion aggregate_operations crash HOT 2
- Encountring "MPI_ERR_COUNT: invalid count argument" when creating GHZ states on multiple nodes HOT 3
- Support for PrimitivesV2 HOT 7
- ImportError: cannot import name 'NoiseModel' from 'qiskit_aer' HOT 2
- No module found qiskit.providers.aes HOT 1
- run_options is poorly documented HOT 3
- Aer sampler does not truncate to active number of qubits HOT 6
- QiskitBackendNotFoundError - Unable to run the backend using BackendEstimator primitive
- CCZ gates aren't accepted by the statevector_simulator HOT 2
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 qiskit-aer.