Qiskit: Difference between revisions
From wikiluntti
(→Theory) |
(→Theory) |
||
Line 13: | Line 13: | ||
Installation https://qiskit.org/documentation/install.html | Installation https://qiskit.org/documentation/install.html | ||
< | <syntaxhighlight> | ||
conda create -n qiskit python=3 | conda create -n qiskit python=3 | ||
conda activate qiskit | conda activate qiskit | ||
pip install qiskit _OR_ pip install qiskit[visualization] | pip install qiskit _OR_ pip install qiskit[visualization] | ||
</ | </syntaxhighlight> | ||
=== Setting Up Qiskit === | === Setting Up Qiskit === | ||
< | <syntaxhighlight> | ||
qc = QuantumCircuit(1) # Create a quantum circuit with one qubit | qc = QuantumCircuit(1) # Create a quantum circuit with one qubit | ||
initial_state = [0,1] # Define initial_state as |1> | initial_state = [0,1] # Define initial_state as |1> | ||
qc.initialize(initial_state, 0) # Apply initialisation operation to the 0th qubit | qc.initialize(initial_state, 0) # Apply initialisation operation to the 0th qubit | ||
qc.draw('text') # Let's view our circuit (text drawing is required for the 'Initialize' gate due to a known bug in qiskit) | qc.draw('text') # Let's view our circuit (text drawing is required for the 'Initialize' gate due to a known bug in qiskit) | ||
</ | </syntaxhighlight> | ||
=== Quantum Gates === | === Quantum Gates === | ||
< | <syntaxhighlight> | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight> | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight> | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight> | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight> | ||
</ | </syntaxhighlight> | ||
== Exercises == | == Exercises == |
Revision as of 11:30, 21 November 2020
Introduction
https://quantum-computing.ibm.com/
https://quantum-computing.ibm.com/challenges/fall-2020
https://quantum-computing.ibm.com/jupyter/user/IBMQuantumChallenge2020/week-1/ex_1a_en.ipynb
Theory
Installation
Installation https://qiskit.org/documentation/install.html
conda create -n qiskit python=3
conda activate qiskit
pip install qiskit _OR_ pip install qiskit[visualization]
Setting Up Qiskit
qc = QuantumCircuit(1) # Create a quantum circuit with one qubit
initial_state = [0,1] # Define initial_state as |1>
qc.initialize(initial_state, 0) # Apply initialisation operation to the 0th qubit
qc.draw('text') # Let's view our circuit (text drawing is required for the 'Initialize' gate due to a known bug in qiskit)
Quantum Gates
Exercises
Week 1
Week 2
Week 3