qiskit-aer | high performance simulator for quantum circuits
kandi X-RAY | qiskit-aer Summary
kandi X-RAY | qiskit-aer Summary
Qiskit is an open-source framework for working with noisy quantum computers at the level of pulses, circuits, and algorithms. Qiskit is made up of elements that each work together to enable quantum computing. This element is Aer, which provides high-performance quantum computing simulators with realistic noise models.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of qiskit-aer
qiskit-aer Key Features
qiskit-aer Examples and Code Snippets
Community Discussions
Trending Discussions on qiskit-aer
QUESTION
My qiskit code's output differ from the Lecturer: Ryan O’Donnell
I am testing the table shown in attached image by using qiskit in python3.8.5 and qiskit version {'qiskit-terra': '0.14.2', 'qiskit-aer': '0.5.2', 'qiskit-ignis': '0.3.3', 'qiskit-ibmq-provider': '0.7.2', 'qiskit-aqua': '0.7.3', 'qiskit': '0.19.6'}
my code is :
...ANSWER
Answered 2020-Aug-10 at 14:42Ahh, I think I see the issue. In the table from lecturer Ryan O'Donnell, the state is read from the first qubit to the last qubit. For example, the state |110> means that the qubit labelled q_0 is in state |1>, q_1 is in state |1> and q_2 is in state |0>. In Qiskit, the label convention is reversed. So, in Qiskit, |110> would actually be read as |011>, since the state is read from the last to the first qubit. So, your code and output is correct, since in Ryan O'Donnell's table, your state |011> is |110>. If this doesn't make sense, let me know.
As to your new code, the reason why you are getting different results than expected is that as you run your for loop, instead of creating new circuits, you are consistently adding to an existing circuit. For example, when applying the first function, bit_000, you apply to ccx gate, barrier, and measure. Then calling bit_001, you add an x gate to q_0 and do the same thing. So far everything is good. Then you add an x gate to q_1 and do the same procedure, but you get the resulting state vector '111'. That is because in qiskit, it thinks there is an x gate on the first and second qubit, so when you apply the ccx gate, you get the result you get. So really, by applying all of those circuit operations, you've made one big circuit instead of 8 isolated circuits. I would initialize all the qubits to the state |0> after each time you measure, which will give you a clean slate to work off for the next circuit. With that edit, you should get the results that are written in Ryan O'Donnell's lecture. Hope this helps!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install qiskit-aer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page