001 - Start Writing Quantum Code with Abby Mitchell: Qiskit Summer School 2024

Finished
Finished
Note
Status
To Learn
Tags
Qiskit
Total Videos
1
Video Duration
00:55:21
notion image
发送数据
返回数据
双向
 
notion image
 
notion image
Here are all the URLs extracted from the image:
  1. https://github.com/Qiskit/qiskit
  1. https://docs.quantum-computing.ibm.com/
  1. https://github.com/Qiskit/qiskit-ibm-runtime
  1. https://docs.quantum-computing.ibm.com/
  1. http://qiskit.github.io/ecosystem
 
notion image
The image shows instructions for getting set up with Qiskit, a quantum computing software development kit. Here are the key points:
  1. To install Qiskit, you need to run two pip install commands:
    1. For more detailed installation instructions, you can visit: https://docs.quantum.ibm.com/start/install
    1. To access IBM quantum hardware, you need to set up credentials through one of two options:
        • IBM Quantum Platform
        • IBM Cloud
    1. For setting up access credentials, you can visit: https://docs.quantum.ibm.com/start/setup-channel
    The image is part of a presentation by Abby Mitchell, who is identified as a Developer Advocacy Lead, during the Qiskit Global Summer School 2024.
     
    notion image
    The image presents the Qiskit Patterns, which outline a four-step process for working with quantum circuits:
    1. Map problem to quantum circuits and operators
    1. Optimize circuits for target hardware
    1. Execute on target hardware
    1. Postprocess results
    These patterns appear to represent a general workflow for developing and executing quantum algorithms using the Qiskit framework.
     
    notion image
    In quantum computing applications, you might be simulating a molecule in chemistry or performing some type of optimization calculation. Generally, you start with a complex equation or numerical representation. The key step is translating that numerical representation into a quantum computing format, which typically takes the form of a quantum circuit.
    As part of this process, you'll need to consider several quantum algorithms. Each algorithm has its own approach to encoding the problem and extracting the solution. Selecting the most appropriate algorithm depends on the specific nature of your problem and the quantum resources available.
    The translation from classical to quantum representation is a crucial and often challenging step. It requires a deep understanding of both the problem domain and quantum computing principles. This process involves mapping your classical variables and operations onto quantum states and gates in a way that preserves the problem's structure while leveraging quantum advantages.
    Once you've created your quantum circuit representation, you can then run it on a quantum computer or simulator to obtain results. These results often need to be interpreted back into the context of your original problem, completing the cycle from classical problem to quantum solution and back to classical interpretation.
     
    notion image
     
    notion image
    The image shows a presentation slide about the Qiskit SDK (Software Development Kit) for quantum computing. The slide highlights that Qiskit includes a library of standard gates and circuits. It lists two main categories:
    1. Standard gates: These include Hadamard, Pauli rotation gates, CNOT, Quantum Fourier Transform, and others.
    1. Variational ansatzes: These are described as parameterized quantum circuits for chemistry and combinatorial optimization, including hardware-efficient ansatzes.
     
    notion image
    The slide outlines two key points for optimizing quantum circuits for hardware:
    1. Required: Transpile your abstract circuit into a circuit that can run on target hardware.
    1. Optional: Verify your circuit with simulation.
     
    notion image
    The slide outlines three main constraints of real quantum devices:
    1. Basis gate set: Only a limited set of gates can be executed directly on the hardware. Other gates must be rewritten in terms of these basis gates.
    1. Qubit connectivity: Only certain pairs of qubits can directly interact with each other. This is illustrated with a diagram showing a grid of interconnected qubits.
    1. Errors: Each operation has a chance of error, so circuit optimizations can greatly affect performance. This is represented by an icon of a broken wine glass.
    The title of the slide states "Real quantum devices are subject to constraints," emphasizing these practical limitations in quantum computing hardware.
     
    notion image
    This slide from the Qiskit Summer School 2024 presented by Abby Mitchell discusses the challenge of running an abstract quantum circuit on a specific quantum device and introduces the solution: transpilation.
    Key points from the slide:
    1. Challenge: Run abstract circuit on a specific quantum device.
    1. Solution: Transpilation - convert abstract circuit into an ISA (instruction set architecture) circuit.
    1. The slide shows an example of transpilation:
        • On the left is a simple abstract circuit with two qubits (q0 and q1), featuring a Hadamard gate (H) and some controlled operations.
        • On the right is the transpiled version of this circuit, which is much more complex and uses specific gates like Rz (rotation around z-axis), √X (square root of X gate), and ECR (Echo Cross Resonance) gates.
    1. The transpiled circuit also shows specific qubit mappings (q1 ↦ 57, q0 ↦ 58), indicating how the logical qubits in the abstract circuit are mapped to physical qubits on the actual device.
    1. The transpiled circuit has a "Global Phase: 2π" note, which is likely an additional phase factor introduced during the transpilation process.
    This slide illustrates how a simple, abstract quantum circuit needs to be transformed into a more complex series of operations that can be directly executed on real quantum hardware, taking into account the specific capabilities and constraints of the target device.
     
    notion image
     
    The image shows a table explaining transpilation terms used in quantum computing, specifically in the context of Qiskit Summer School 2024. The table has three columns: Term, Definition, and Orchestra analogy. It defines three key terms:
    1. Pass: A standalone circuit or metadata transformation, analogous to an instrument in an orchestra.
    1. Pass manager: A list of transpiler passes grouped into a logical unit, comparable to an instrument section in an orchestra.
    1. Staged pass manager: A list of pass managers, each representing a discrete stage of a transpilation pipeline. This is likened to the conductor in an orchestra.
    The slide is titled "Transpilation terms" and appears to be part of a presentation or lecture on quantum code writing. The presenter, identified as Abby Mitchell (Developer Advocacy Lead), can be seen in a small video window in the corner of the image.
    The information presented here seems to be educational material aimed at explaining concepts in quantum computing, specifically related to the process of transpilation in quantum circuits.
     
    notion image
    Here are the key points:
    1. The title of the slide is "Transpile a circuit with Qiskit SDK".
    1. The steps listed are:
        • Choose which device backend you want to target
        • Create a preset staged pass manager with your desired optimization level
        • Run the staged pass manager on the circuit
    1. The code snippet demonstrates:
        • Importing necessary modules from Qiskit
        • Creating a quantum register and circuit
        • Applying quantum gates (H and CX) to qubits
        • Initializing a QiskitRuntimeService
        • Setting up a backend ("ibm_brisbane")
        • Generating a preset pass manager with optimization level 3
        • Running the pass manager on the circuit
        • Drawing the resulting circuit
    1. There's a visual representation of a quantum circuit at the bottom of the slide, showing operations on two qubits (q0 and q1).
    1. The presenter is identified as Abby Mitchell, Developer Advocacy Lead.
    1. This appears to be part of the Qiskit Global Summer School 2024, as indicated at the bottom of the slide.
     
    notion image
    The slide discusses the six stages of a transpiler in quantum computing:
    1. Initialization: Preparing the circuit for transpilation, including decomposing multi-qubit gates into two-qubit gates.
    1. Layout: Mapping abstract qubits of the circuit to physical qubits on the device.
    1. Routing: Inserting swap gates to enable interactions between qubits that are not physically connected.
    1. Translation: Translating the gates of the circuit to the basis gate set of the device.
    1. Optimization: Rewriting the circuit to minimize its depth (number of operations) to decrease the effect of errors.
    1. Scheduling: Adding delay instructions to align the circuit with the hardware's timing.
     
    notion image
    Additional transpilation tools
    • Qiskit transpiler service
    • Qiskit Ecosystem, e.g., circuit-knitting-toolbox
    • Write your own transpiler plugins
    notion image
     
    notion image
     
    notion image
    • Problem: The runtime cost of simulating quantum circuits scales exponentially with the number of qubits.
    • Limitation: Circuits with approximately 50 or more qubits cannot be simulated.
    • Techniques for handling large circuits: a. Test smaller versions of the circuit b. Modify the circuit to make it classically simulatable, using a stabilizer circuit (also known as a Clifford circuit)
     
    notion image
    This image presents information about two types of primitives in quantum computing: the Sampler primitive and the Estimator primitive. Here's a breakdown of the key points:
    1. Main concept: "Primitives encapsulate the output of a quantum circuit"
    1. Sampler primitive:
        • Represented by a bell curve graph
        • Output is a mapping of bitstrings to counts, e.g., {'0': 12, '1': 9}
        • The circuit should include measurements
        • Shows a quantum circuit diagram with two qubits and measurement operations
    1. Estimator primitive:
        • Represented by a graph with error bars
        • Output is the expectation value of an observable, e.g., the net spin of a system
        • The circuit should not include measurements
        • Shows a simpler quantum circuit diagram without measurement operations
    This slide illustrates the difference between these two primitives in terms of their output and the structure of their quantum circuits, particularly highlighting the presence or absence of measurement operations.
     
    notion image
    The image shows a step-by-step guide and corresponding Python code for running a quantum circuit on quantum hardware using Qiskit, a quantum computing framework. Here's a summary of the key steps and code elements:
    1. Initialize the Qiskit Runtime service: The code creates a QiskitRuntimeService object.
    1. Choose a hardware backend: It selects the least busy operational backend with at least 127 qubits.
    1. Initialize a Qiskit Runtime primitive: The code creates a random Hermitian matrix and converts it to a quantum circuit using IQP (Instantaneous Quantum Polynomial).
    1. Invoke the primitive with your circuit: It uses a Sampler to run the circuit on the chosen backend and retrieve the results.
    The code imports necessary libraries, sets up the quantum environment, creates and measures a circuit, and then executes it on the selected quantum hardware. This process allows for running quantum algorithms on real quantum computers or simulators.
     
     
    notion image
    Twirled Readout Error eXtinction (TREX) measurement twirling is an error mitigation technique used in quantum computing. Here's a brief introduction:
    1. Purpose: TREX aims to reduce readout errors that occur when measuring the state of qubits at the end of a quantum circuit.
    1. Concept: It involves applying additional quantum operations (gates) before measurement to "twirl" or randomize the readout errors.
    1. Process:
        • Apply random single-qubit gates before measurement
        • Repeat the circuit multiple times with different random gates
        • Average the results to cancel out systematic readout errors
    1. Advantages:
        • Can significantly improve the accuracy of qubit measurements
        • Helps mitigate bias in readout errors
    1. Considerations:
        • Requires running the circuit multiple times, increasing the overall runtime
        • Part of a broader set of error mitigation techniques in quantum computing
    1. Implementation: TREX is typically implemented at the software level in quantum computing frameworks like Qiskit, as mentioned in the image.
    TREX is particularly useful in noisy intermediate-scale quantum (NISQ) devices, where readout errors can significantly impact the results of quantum algorithms. By applying this technique, researchers and developers can obtain more reliable results from their quantum computations.
    notion image
     
    notion image
     
    notion image
     
     
    notion image
     
    notion image
     
    notion image
     
    notion image
     
    notion image
     
    notion image
     
     
    lab-0
    Bell state questions:
    Here we create some operators for our two qubits. Some (like XX) measure both qubits, while others (like XI) only measure one. Later we will check their expectation values to make sure our circuit is working properly. Because we've created an entangled Bell state, we should expect that our operators only measuring one qubit have an expectation value of 0. Similarly, we should expect the operators which measure both qubits to come back with some non-zero (hopefully close to 1) expectation value.
     
    why?
     
    1. Bell state: Let's consider the Bell state $$|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$$
    1. Single-qubit measurements: For a single-qubit measurement, let's consider measuring the first qubit in the computational basis. The density matrix for the first qubit is:
    $$\rho_1 = \text{Tr}_2(|\Phi^+\rangle\langle\Phi^+|) = \frac{1}{2}|0\rangle\langle0| + \frac{1}{2}|1\rangle\langle1| = \frac{1}{2}I$$
    This is the maximally mixed state. For any single-qubit Pauli operator $$P \in \{X, Y, Z\}$$, the expectation value is:
    $$\langle P \rangle = \text{Tr}(P\rho_1) = \text{Tr}(P \cdot \frac{1}{2}I) = 0$$
    This explains the zero expectation value for single-qubit measurements.
    1. Two-qubit measurements: For two-qubit measurements, let's consider the operator $$XX$$. Its expectation value is:
    $$\langle XX \rangle = \langle\Phi^+|XX|\Phi^+\rangle$$ $$= (\frac{1}{\sqrt{2}}\langle00| + \frac{1}{\sqrt{2}}\langle11|)(XX)(\frac{1}{\sqrt{2}}|00\rangle + \frac{1}{\sqrt{2}}|11\rangle)$$ $$= \frac{1}{2}(\langle00|11\rangle + \langle11|00\rangle) = 1$$
    Similarly, for $$ZZ$$:
    $$\langle ZZ \rangle = \langle\Phi^+|ZZ|\Phi^+\rangle = 1$$
    These non-zero (actually +1) expectation values for two-qubit Pauli product operators reflect the strong correlations in the Bell state.
    In general, for Bell states, we have:
    $$\langle XX \rangle = \langle YY \rangle = \langle ZZ \rangle = \pm 1$$
    while
    $$\langle XI \rangle = \langle IX \rangle = \langle YI \rangle = \langle IY \rangle = \langle ZI \rangle = \langle IZ \rangle = 0$$
    This mathematical formulation demonstrates why single-qubit measurements yield zero expectation values, while certain two-qubit measurements yield non-zero (specifically ±1) expectation values, capturing the essence of entanglement in Bell states.
     
    Excellent question! Let's dive into the details of ρ_1 and the partial trace calculation.
    1. What is ρ_1?
    ρ_1 is the reduced density matrix of the first qubit in our two-qubit system. It represents the quantum state of the first qubit when we ignore (or trace out) the second qubit.
    1. How to calculate ρ_1:
    We calculate ρ_1 using the partial trace operation, denoted as Tr_2, which traces out the second qubit:
    $$\rho_1 = \text{Tr}_2(|\Phi^+\rangle\langle\Phi^+|)$$
    1. How to calculate the partial trace:
    Let's go through this step-by-step for our Bell state $$|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$$:
    a) First, we form the density matrix of the full two-qubit system:
    $$|\Phi^+\rangle\langle\Phi^+| = \frac{1}{2}(|00\rangle + |11\rangle)(\langle00| + \langle11|)$$ $$= \frac{1}{2}(|00\rangle\langle00| + |00\rangle\langle11| + |11\rangle\langle00| + |11\rangle\langle11|)$$
    b) To perform the partial trace, we trace out the second qubit. This means we sum over the basis states of the second qubit:
    $$\rho_1 = \text{Tr}2(|\Phi^+\rangle\langle\Phi^+|) = \sum{i=0}^1 \langle i|_2 |\Phi^+\rangle\langle\Phi^+| |i\rangle_2$$
    c) Let's calculate each term:
    For i = 0: $$\langle0|_2 (\frac{1}{2}|00\rangle\langle00|) |0\rangle_2 = \frac{1}{2}|0\rangle\langle0|$$ $$\langle0|_2 (\frac{1}{2}|00\rangle\langle11|) |0\rangle_2 = 0$$ $$\langle0|_2 (\frac{1}{2}|11\rangle\langle00|) |0\rangle_2 = 0$$ $$\langle0|_2 (\frac{1}{2}|11\rangle\langle11|) |0\rangle_2 = 0$$
    For i = 1: $$\langle1|_2 (\frac{1}{2}|00\rangle\langle00|) |1\rangle_2 = 0$$ $$\langle1|_2 (\frac{1}{2}|00\rangle\langle11|) |1\rangle_2 = 0$$ $$\langle1|_2 (\frac{1}{2}|11\rangle\langle00|) |1\rangle_2 = 0$$ $$\langle1|_2 (\frac{1}{2}|11\rangle\langle11|) |1\rangle_2 = \frac{1}{2}|1\rangle\langle1|$$
    d) Summing these terms:
    $$\rho_1 = \frac{1}{2}|0\rangle\langle0| + \frac{1}{2}|1\rangle\langle1| = \frac{1}{2}I$$
    This result shows that the reduced density matrix of the first qubit is the maximally mixed state, which explains why single-qubit measurements on a Bell state yield zero expectation values for Pauli operators.
    The partial trace operation effectively "averages out" the influence of the second qubit, leaving us with a description of the first qubit alone. In entangled states like the Bell state, this averaging results in a maximally mixed state for each individual qubit, despite the strong correlations that exist between the qubits.
     
    • Giscus
    quantum
    literature base
    video notes