41 lines
2.9 KiB
Markdown
41 lines
2.9 KiB
Markdown
|
# Qiskit
|
|||
|
|
|||
|
Qiskit is the fundamental thingy(best way to describe it at this point) that a lot of quantum computers will refer to nowadays (at least for the moment) from IBM. We first have to create a conda environment (or a xonsh one!) in which we install qiskiet and all necessary distributions. Here are the docs to get [started](https://qiskit.org/documentation/getting_started.html).
|
|||
|
|
|||
|
---
|
|||
|
|
|||
|
There seems to be qiskit distributions for:
|
|||
|
- qiskit-visualization
|
|||
|
- [qiskit-nature](obsidian://open?vault=Coding%20Tips&file=Qiskit-Nature)
|
|||
|
- qiskiet-metal
|
|||
|
|
|||
|
---
|
|||
|
|
|||
|
- here is a talk on [creating a quantum compiler](https://www.youtube.com/watch?v=tviemvEWhps) through IBM research
|
|||
|
- [code your first quantum circuit ](https://quantum-computing.ibm.com/lab/docs/iql/first-circuit)via qisket and IBM Quantum Lab
|
|||
|
|
|||
|
A quantum circuit is a graphic representation of a quantum algorithm.
|
|||
|
> The circuit shows that the output of the measurement of the qubit, whose state was |+〉, is 0 with probability 1/2 or 1 with the same probability. Fig. 2.2 shows the histogram of the 3 probability distribution generated in Qiskitwith two iterations.
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
* *highlighted by Shwetha Jayaraj at page 12 on [[BasicQuantumAlgorithms.pdf]]*
|
|||
|
|
|||
|
> The circuit shows that the output of the measurement of the qubit, whose state was |+〉, is 0 with probability 1/2 or 1 with the same probability. Fig. 2.2 shows the histogram of the 3 probability distribution generated in Qiskitwith two iterations.
|
|||
|
|
|||
|
|
|||
|
|
|||
|
* *highlighted by Shwetha Jayaraj at page 12 on [[BasicQuantumAlgorithms.pdf]]*
|
|||
|
|
|||
|
> Implementing on IBM quantum computers 5 At this point, it is a good idea to use IBM’s composer. After logging in IBM’s website(registration is needed), we have to launch the composer by clicking on Launch Composer . IBM’ composer is friendly because we can drag the available gates into the circuit. Let us keep it to a basic use at this moment. Fig. 2.3 shows a circuit with the Hadamard gate followed by a measurement. We simply drag H and drop it on the first wire of the circuit, then we drag the meter and drop it after H. The meter’s arrow shows that the output is re-directed to a auxiliary classical register at the bottom of the circuit
|
|||
|
|
|||
|
|
|||
|
|
|||
|
* *highlighted by Shwetha Jayaraj at page 15 on [[BasicQuantumAlgorithms.pdf]]*
|
|||
|
|
|||
|
> After the circuit is ready, we click on Setup and run , and then we have two options: (1) Run the circuit on a quantum computer by selecting one of the available quantum systems, or (2) sim ulate the circuit by selecting a simulator. It is usually better to start with the second option as the provider, then we select the number of shots and then weWe select ibm qasm simulator click on Run at the bottom. Fig. 2.4 shows the output of an execution. The result 000 was obtained 503 times and 001 was obtained 521 times out of 1024 shots.
|
|||
|
|
|||
|
|
|||
|
|
|||
|
* *highlighted by Shwetha Jayaraj at page 15 on [[BasicQuantumAlgorithms.pdf]]*
|