Browse the glossary using this index

Special | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ALL

Q

Picture of Yee Wei Law

Qiskit: setup

by Yee Wei Law - Friday, 9 August 2024, 1:10 PM
 

This entry continues from installation of QuTiP.

  1. Make sure you are in a Conda command prompt and the environment “cyber” is activated. As per official documentation, install qiskit and galois:

    pip install qiskit[visualization] qiskit-aer qiskit-ibm-runtime galois

    galois is not necessary for qiskit but necessary for our courses.

    Qiskit usually uses NumPy of a lower version than what QuTiP uses, so expect existing NumPy to be downgraded.

  2. Subsequently, as per official documentation, install the qiskit_textbook package:

    pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src

    Qiskit Textbook is a community project offering learning resources that will be useful to us.

  3. Test Qiskit in a Python shell:

    Fig: 1: Testing Qiskit in a Python shell.

    The two commands in the screenshot above ☝ should not trigger any error.

  4. Next, test Qiskit in JupyterLab. To launch JupyterLab, as per official documentation, open a Conda prompt (not Python shell) and type:

    jupyter lab

    Expect a web browser window to be launched, where you can create a new “Python 3 (ipykernel)” notebook:

    Fig: 2: JupyterLab landing page.

    Note ipykernel is an interactive Python kernel for Jupyter.

    Copying the first piece of code from the “Introduction to Qiskit” tutorial and pasting it into the newly created “Python 3 (ipykernel)” notebook should produce the circuit diagram at the bottom of this screenshot:

    Fig: 3: Sample Qiskit code running in Jupyter notebook.

Qiskit comes with a super-quick introduction to Python and Jupyter notebooks.

Visual Studio Code is a popular alternative to a web browser for hosting Jupyter notebooks, but to minimise the number of software components that can go wrong, we shall stick with a web browser (for which Mozilla Firefox is recommended).

Tags:

Picture of Yee Wei Law

Quantum bit error rate (QBER)

by Yee Wei Law - Monday, 13 March 2023, 4:25 PM
 

The quantum bit error rate (QBER) is the error rate affecting two bitstrings obtained as a result of the same quantum measurement performed on two different sets of quantum systems [Gra21, p. xvi].

See BB84 to put this definition in context.

References

[Gra21] F. Grasselli, Quantum Cryptography: From Key Distribution to Conference Key Agreement, Quantum Science and Technology, Springer Cham, 2021. https://doi.org/10.1007/978-3-030-64360-7.

Picture of Yee Wei Law

Quantum supremacy

by Yee Wei Law - Monday, 20 November 2023, 10:26 PM
 

Picture of Yee Wei Law

Qubit: physical realisation

by Yee Wei Law - Thursday, 10 August 2023, 9:14 AM
 

Creating a low voltage to represent a logical “0” and a high voltage to represent a logical “1” is straightforward.

🤷‍♂️ Creating a superposition of low and high voltages however is not.

A quantum computer is commonly envisioned to be a machine that exploits the full complexity of a many-particle quantum wavefunction to solve computational problems [LJL+10].

  • The current state of quantum computing technologies is summarised by the keywords Noisy Intermediate-Scale Quantum (NISQ).
  • NISQ computers are subject to substantial error rates and has a limited number of qubits [LLSK22, Sec. 1].

For the construction of quantum computers, laser serves as an inspiration because it is quantum mechanics that enables laser waves to be generated in phase [LJL+10].

Just as there are many possible materials for lasers (e.g., crystals, organic dye molecules, semiconductors, free electrons), there are many materials under consideration for quantum computers; see [LJL+10] and [MM12, Ch. 6].

Quantum bits are often imagined to be constructed from the smallest form of matter, e.g., an isolated atom, through ion traps and optical lattices, but they can also be made in components far larger than consumer electronics, e.g., a superconducting system [LJL+10].

Below we discuss three main technologies [LLSK22, Sec. 6]: 1️⃣ trapped ions, 2️⃣ photonics, and 3️⃣ superconducting qubits.

Trapped ions: Main idea is to use the two different internal states of a trapped atomic ion as a two-level system (i.e., qubit) [LLSK22, Sec. 6.2].

An ion trap uses electromagnetic fields and laser cooling to control the spatial position of an ion in vacuum and reduce the temperature of the ion [LLSK22, Sec. 6.2; BCSH21, Sec. 2].

Watch an introduction to the ion trap:

Lasers or microwaves are used to control the internal states of an ion [BCSH21, Figure 1].

The internal control plus the Coulomb repulsion between ions combine to form conditional logic gates [BCSH21, Figure 1].

👍: State preparation, qubit measurement, single-qubit and two-qubit gates can be performed with fidelities (> 99%) higher than what is required for quantum error correction [LLSK22, Sec. 6.2].

👎: A large array of bulk optical components are necessary and these are difficult to address and measure, challenging scalability [LLSK22, Sec. 6.2].

Trapped-ion quantum computers (e.g., IonQ) are enjoying a reasonable level of commercial success [LLSK22, Sec. 6.2].

Photonics: Photonics has always been a prominent candidate for realising qubits [LLSK22].

For generating qubits, photonics offers the following advantages [SP19, PAB+20, LLSK22]:

  • Photons are clean and decoherence-free quantum systems for which single-qubit operations can be easily performed with high fidelity, making photons a flagship system for studying quantum mechanics and developing quantum technologies.
  • Quantum entanglement, teleportation, QKD, and early quantum computing demonstrations were pioneered in photonics because photons represent a naturally mobile and low-noise system with quantum-limited detection readily available.
  • The quantum states of individual photons can be manipulated with high precision using interferometry, an experimental staple that has been under continuous development since the 19th century.
  • The ability to generate large numbers of photons and the development of integrated platforms, improved sources and detectors, novel noise-tolerant theoretical approaches render photonics a leading contender for both quantum information processing and quantum networking.
  • Nowadays, photonic quantum computing represents a promising path to medium- and large-scale processing.
  • Photonics is the primary technology for realising quantum communications.

Superconducting qubits: They are currently the leading contenders in the race for large-scale quantum computing [LLSK22]. Superconducting qubits are the technology big-tech companies like Google and IBM have been focusing on.

Fig. 1: The Sycamore processor [ABB+19, Fig. 1]: (Left) Processor layout comprising a rectangular array of 54 qubits (grey), each of which is connected to four neighbours through couplers (blue). The inoperable qubit is outlined. (Right) Photograph of the Sycamore chip.

In 2019, a large research team consisting of Google and multiple American and European universities demonstrated “quantum supremacy” on a programmable superconducting quantum processor called “Sycamore”, which consists of a two-dimensional array of 54 transmon qubits [AAB+19]:

  • In the superconducting circuit of Sycamore, conduction electrons condense into a macroscopic quantum state, such that currents and voltages behave quantum-mechanically.
  • Transmon is short for “transmission-line shunted plasma oscillation”.
  • The employed transmon qubits can be thought of as nonlinear superconducting resonators at 5-7 GHz, and each qubit encodes the two lowest quantum eigenstates of the resonant circuit.
  • Each qubit is connected to its four neighbouring qubits using an adjustable coupler for tuning inter-qubit coupling. 💡 Coupling qubits is essential for implementing two-qubit gates.
  • Each qubit is also connected to a linear resonator used to read out the qubit state.
  • Sycamore’s record might have been broken by China’s Zuchongzi in 2021 [Cho21].
  • In 2023, Google demonstrated quantum supremacy again with an increased qubit count of 70 [MVM+23].
  • IBM is slated to launch its 1121-bit NISQ computer called Condor.

References

[AAB+19] F. Arute, K. Arya, R. Babbush, D. Bacon, J. C. Bardin, R. Barends, R. Biswas, S. Boixo, F. G. S. L. Brandao, D. A. Buell, B. Burkett, Y. Chen, Z. Chen, B. Chiaro, R. Collins, W. Courtney, A. Dunsworth, E. Farhi, B. Foxen, A. Fowler, C. Gidney, M. Giustina, R. Graff, K. Guerin, S. Habegger, M. P. Harrigan, M. J. Hartmann, A. Ho, M. Hoffmann, T. Huang, T. S. Humble, S. V. Isakov, E. Jeffrey, Z. Jiang, D. Kafri, K. Kechedzhi, J. Kelly, P. V. Klimov, S. Knysh, A. Korotkov, F. Kostritsa, D. Landhuis, M. Lindmark, E. Lucero, D. Lyakh, S. Mandrà, J. R. McClean, M. McEwen, A. Megrant, X. Mi, K. Michielsen, M. Mohseni, J. Mutus, O. Naaman, M. Neeley, C. Neill, M. Y. Niu, E. Ostby, A. Petukhov, J. C. Platt, C. Quintana, E. G. Rieffel, P. Roushan, N. C. Rubin, D. Sank, K. J. Satzinger, V. Smelyanskiy, K. J. Sung, M. D. Trevithick, A. Vainsencher, B. Villalonga, T. White, Z. J. Yao, P. Yeh, A. Zalcman, H. Neven, and J. M. Martinis, Quantum supremacy using a programmable superconducting processor, Nature 574 no. 7779 (2019), 505–510. https://doi.org/10.1038/s41586-019-1666-5.
[BCSH21] K. R. Brown, J. Chiaverini, J. M. Sage, and H. Häffner, Materials challenges for trapped-ion quantum computers, Nature Reviews Materials 6 no. 10 (2021), 892–905. https://doi.org/10.1038/s41578-021-00292-1.
[Cho21] C. Q. Choi, Two of World’s Biggest Quantum Computers Made in China > Quantum computers Zuchongzi and Jiuzhang 2.0 may both display "quantum primacy" over classical computers, IEEE Spectrum Computing news, 2021. https://spectrum.ieee.org/quantum-computing-china.
[LJL+10] T. D. Ladd, F. Jelezko, R. Laflamme, Y. Nakamura, C. Monroe, and J. L. O’Brien, Quantum computers, Nature 464 no. 7285 (2010), 45–53. https://doi.org/10.1038/nature08812.
[LLSK22] J. W. Z. Lau, K. H. Lim, H. Shrotriya, and L. C. Kwek, NISQ computing: where are we and where do we go?, AAPPS Bulletin 32 no. 1 (2022), 27. https://doi.org/10.1007/s43673-022-00058-z.
[MM12] D. C. Marinescu and G. M. Marinescu, Classical and Quantum Information, Elsevier, 2012. https://doi.org/10.1016/C2009-0-64195-7.
[MVM+23] A. Morvan, B. Villalonga, X. Mi, S. Mandrà, A. Bengtsson, P. V. Klimov, Z. Chen, S. Hong, C. Erickson, I. K. Drozdov, J. Chau, G. Laun, R. Movassagh, A. Asfaw, L. T. A. N. Brandão, R. Peralta, D. Abanin, R. Acharya, R. Allen, T. I. Andersen, K. Anderson, M. Ansmann, F. Arute, K. Arya, J. Atalaya, J. C. Bardin, A. Bilmes, G. Bortoli, A. Bourassa, J. Bovaird, L. Brill, M. Broughton, B. B. Buckley, D. A. Buell, T. Burger, B. Burkett, N. Bushnell, J. Campero, H. S. Chang, B. Chiaro, D. Chik, C. Chou, J. Cogan, R. Collins, P. Conner, W. Courtney, A. L. Crook, B. Curtin, D. M. Debroy, A. D. T. Barba, S. Demura, A. D. Paolo, A. Dunsworth, L. Faoro, E. Farhi, R. Fatemi, V. S. Ferreira, L. F. Burgos, E. Forati, A. G. Fowler, B. Foxen, G. Garcia, E. Genois, W. Giang, C. Gidney, D. Gilboa, M. Giustina, R. Gosula, A. G. Dau, J. A. Gross, S. Habegger, M. C. Hamilton, M. Hansen, M. P. Harrigan, S. D. Harrington, P. Heu, M. R. Hoffmann, T. Huang, A. Huff, W. J. Huggins, L. B. Ioffe, S. V. Isakov, J. Iveland, E. Jeffrey, Z. Jiang, C. Jones, P. Juhas, D. Kafri, T. Khattar, M. Khezri, M. Kieferová, S. Kim, A. Kitaev, A. R. Klots, A. N. Korotkov, F. Kostritsa, J. M. Kreikebaum, D. Landhuis, P. Laptev, K. M. Lau, L. Laws, J. Lee, K. W. Lee, Y. D. Lensky, B. J. Lester, A. T. Lill, W. Liu, A. Locharla, F. D. Malone, O. Martin, S. Martin, J. R. McClean, M. McEwen, K. C. Miao, A. Mieszala, S. Montazeri, W. Mruczkiewicz, O. Naaman, M. Neeley, C. Neill, A. Nersisyan, M. Newman, J. H. Ng, A. Nguyen, M. Nguyen, M. Y. Niu, T. E. O’Brien, S. Omonije, A. Opremcak, A. Petukhov, R. Potter, L. P. Pryadko, C. Quintana, D. M. Rhodes, C. Rocque, P. Roushan, N. C. Rubin, N. Saei, D. Sank, K. Sankaragomathi, K. J. Satzinger, H. F. Schurkus, C. Schuster, M. J. Shearn, A. Shorter, N. Shutty, V. Shvarts, V. Sivak, J. Skruzny, W. C. Smith, R. D. Somma, G. Sterling, D. Strain, M. Szalay, D. Thor, A. Torres, G. Vidal, C. V. Heidweiller, T. White, B. W. K. Woo, C. Xing, Z. J. Yao, P. Yeh, J. Yoo, G. Young, A. Zalcman, Y. Zhang, N. Zhu, N. Zobrist, E. G. Rieffel, R. Biswas, R. Babbush, D. Bacon, J. Hilton, E. Lucero, H. Neven, A. Megrant, J. Kelly, I. Aleiner, V. Smelyanskiy, K. Kechedzhi, Y. Chen, and S. Boixo, Phase 3 transition in random circuit sampling, arXiv preprint arXiv:2304.11119, 2023. https: //doi.org/10.48550/arXiv.2304.11119.
[SP19] S. Slussarenko and G. J. Pryde, Photonic quantum information processing: A concise review, Applied Physics Reviews 6 no. 4 (2019), 041303. https://doi.org/10.1063/1.5115814.
Tags:

Picture of Yee Wei Law

QuTiP (Quantum Toolbox in Python): setup

by Yee Wei Law - Sunday, 23 June 2024, 8:58 AM
 

There is no shortage of quantum computing frameworks/toolkits, including Google’s Cirq, Rigetti’s Forest SDK (including pyQuil), Microsoft’s Q#-based Quantum Development Kit, IBM’s Qiskit, Quipper, QuTiP, ETHZ’s Silq, Cambridge Quantum Computing’s tket.

We shall use Qiskit because 1️⃣ it is among the most well-established (see Google Trends), and 2️⃣ it comes with rich learning resources.

  • Qiskit is an open-source Python-based SDK created by IBM for working with quantum computers at the level of pulses, circuits, and application modules.

We shall also use QuTiP, because while Qiskit is popular for quantum computing, QuTiP offers more features for quantum-dynamical simulations.

  • Simplistically speaking, Qiskit is more for computer scientists, whereas QuTiP is more for physicists.
  • Unlike Qiskit, which uses quantum circuits (QuantumCircuit) as the main building blocks, QuTiP uses “quantum objects” (QObj).

Watch an introduction to QuTiP:

Using Qiskit and QuTiP means we are using Python but there are so many resources for learning Python it should not be an issue for a Bachelor/Master student to pick it up along the way.

Even though the relevant computer pools will provide you with the required software, you need to install the software on your own computer(s) anyway, because you will not be able to finish any of the practicals within the allocated time.

The allocated time is only for you to get enough supervision so that you can complete the remainder of the practical on your own.

Our strategy here is to first install QuTiP, then Qiskit.

The operating system of choice for many computer scientists and cryptograhers is Linux, but the setup guide here is only applicable to Windows, because UniSA computer pools have only Windows.

Follow the instructions below (derived from the official instructions) to set up QuTiP:

  1. Install the Python distribution Miniconda, or Anaconda if you prefer installing more packages upfront.

    Upon successful installation of 64-bit Conda (short for “Miniconda/Anaconda”), you will see folder “Anaconda3 (64-bit)” on your Start menu, and under the folder, menu item “Anaconda Prompt (miniconda3)” 👈 Click this menu item to get a Conda command prompt.

    In the command prompt, run command to update Conda to the latest version:

    conda update conda
  2. Upon successful update of conda, in command line, create a conda environment called cyber (which can otherwise be any name you fancy):

    conda create -n cyber

    Environment is an essential feature of Conda for creating sandboxes for prototyping, development and experimentation. Read this guide to get a better understanding of Conda environments, including how to create/activate/list/deactivate/remove environments.

    Upon successful creation of the environment cyber, activate it:

    conda activate cyber
  3. Add the channel conda-forge to the list of channels (to be sure, keeping defaults at the highest priority) and install the necessary packages:

    conda config --append channels conda-forge
    conda install qutip pytest jupyterlab jupyterlab-git ipywidgets jupyterlab_widgets nodejs `
    seaborn numba numexpr pandas pandoc sympy
  4. Above, the backtick (`) is the line continuation character in PowerShell.

    Among the packages just installed,

    • pytest is for automating testing of Python code (e.g., of QuTiP).
    • jupyterlab is the JupyterLab package that will provide our graphical user interface (GUI).
    • jupyterlab-git is for version-controlling Jupyter notebooks.
    • ipywidgets and jupyterlab_widgets are libraries of Jupyter widgets.
    • nodejs is cross-platform Javascript runtime environment useful for JupyterLab.
    • seaborn is a Python data visualization library based on matplotlib.
    • numpy is not shown above, but is automatically installed with qutip. This is the fundamental package for scientific computing with Python.
    • numba is a just-in-time compiler that translates a subset of Python and NumPy code into fast machine code.
    • numexpr is for accelerating numerical evaluation of expressions in NumPy.
    • scipy is not shown above, but is automatically installed with qutip. This complements numpy for scientific computing with Python.
    • pandas is a data analysis library.
    • pandoc is a versatile document converter.
    • sympy is a versatile computer algebra system for symbolic computing.
    • pip is not shown above, but is a common dependency that is automatically installed by many other packages. It is a package installer for Python.

    Official Conda documentation discourages using pip and conda together, but we need pip for Qiskit later.

  5. Optional: Test your setup by running the official unit tests in a Python shell:

    import qutip.testing
    qutip.testing.run()

    These tests are computationally intensive and can slow down your computer dramatically. For reference, on a Intel Core i9-9880H CPU with 32 GB RAM, the tests take between 35 and 40 minutes.

  6. Continue to installation of Qiskit.
Tags: