Introducing Bosonic Qiskit: A package for simulating bosonic and hybrid qubit-bosonic circuits

Qiskit
Qiskit
Published in
10 min readFeb 22, 2023

By Kevin C. Smith, Eleanor Crane, Tim Stavenger, S.M. Girvin

More information about Bosonic Qiskit, including installation instructions, can be found at the GitHub repository. We particularly encourage new users to look at the tutorials and PyTest test cases. To work through the examples demonstrated in this article, see the Jupyter notebook here. Bosonic Qiskit is an extension to Qiskit developed within the NQI center C2QA, led by Brookhaven National Lab and comprising national labs, universities, research centers and industry partners, including IBM.

The qumode: An alternative building-block for quantum computing

We typically think of quantum computers as devices capable of storing and manipulating quantum information encoded by an ensemble of qubits, physically realized in a superconducting circuit, trapped ion, photonic or other architecture. However, the choice of using qubits — two-level quantum systems — as the fundamental information building block is by no means unique. And in certain contexts, it’s not the most pragmatic. Instead, it is advantageous (particularly for quantum error correction and quantum simulation) to consider alternative schemes where the fundamental building blocks contain not just two levels, but many levels.

A promising way to do this is to incorporate physical hardware which supports bosonic modes, either in addition to qubits (i.e., hybrid qubit-bosonic hardware) or replacing them entirely (as in continuous-variable quantum computing). A bosonic mode is akin to a quantum harmonic oscillator and, in the context of quantum computation, is often referred to as a qumode. While a qubit stores information in an arbitrary superposition of two possible states, |0⟩ and |1⟩, a qumode involves a countably infinite number of basis states labelled |n⟩, where n — the occupancy of the mode — can take on any integer in the range [0, ∞).

With Bosonic Qiskit, users can now construct, simulate, and analyze quantum circuits which include qumodes alongside qubits, all within a workflow that should feel familiar to those who are already comfortable with the Qiskit software stack. Features include:

• Initialization of qumode registers alongside qubit registers, and a new continuous-variable circuit class which supports both simultaneously.

• Built-in implementation of gates common to the circuit-QED architecture, including:

  • Single qumode gates: displacement, squeezing
  • Multi-qumode gates: beamsplitter, two-mode squeezing
  • Hybrid qubit-qumode gates: controlled-displacement, SNAP

• Functionality for user-defined hybrid qubit-qumode gates.

• State readout and phase-space visualization tools, including Fock-basis measurement and Wigner tomography visualization/animation functions.

• Simulation support for amplitude-damping noise model (e.g., photon- or phonon-loss)

Figure 1: (a) Whereas a qubit has two levels, a qumode (equivalent to a quantum harmonic oscillator) is formally described by an infinite number of levels. (b) A few examples of experimental quantum computing platforms that support both qumodes and qubits. While the current gate set implemented in Bosonic Qiskit is tailored towards circuit QED, it can be used to simulate qumodes in a variety of platforms.

Why Qumodes?

There are two representative applications for which hardware supporting bosonic modes can be beneficial over the qubit-only paradigm.

The first entails error correction. An increasingly promising approach to this fundamentally important problem is to encode a logical qubit in the vast Hilbert space of a bosonic mode and employ the “extra space” for error-correction. This strategy is hardware-efficient, as the redundancy required in error-correction is provided by a single degree of freedom, in contrast to qubit-based error correction which requires many qubits. There are many options for how to embed a logical qubit in a bosonic mode, e.g., the cat code [Ref 1,2], binomial code [3, 4], and GKP code [5, 6, 7]. All three of these codes have experimentally reached or exceeded “break-even,” (i.e., the lifetime of the logical qubit exceeds that of all base components in the system), a feat yet to be achieved in qubit-based error correction.

The other arena in which bosonic and hybrid qubit-bosonic hardware is attractive is quantum simulation. While there exist a plethora of examples in nature of physical systems well-represented by two-level systems (e.g. the polarization of light, or the occupancy of an atomic orbital), equally ubiquitous is the quantum harmonic oscillator, appearing in a diversity of contexts, from the vibrational modes of a molecule to the fundamental character of elementary force-carrying particles. For example, sunlight is composed of massless bosons emitted from a fusion reaction in which atomic nuclei collide. In airports, molecules are routinely detected and identified using Raman spectroscopy, whereby determination of its vibrational modes provides a unique “fingerprint” [8]. This begs the question: what is the most natural hardware to simulate such phenomena?

Given some cutoff (i.e., some maximum occupancy n), it is always possible to encode a qumode using many qubits [9]. However, this comes with major drawbacks: For one, it necessitates at least log(n) qubits — not immediately prohibitive for a single mode, but potentially cumbersome if one wishes to simulate a model with many bosonic modes, particularly in the NISQ era. A much bigger problem, though, is the relative difficulty with which typical bosonic gates (e.g., displacement, squeezing, beamsplitter) are implemented in qubit-based encodings, oftentimes requiring highly nonlocal multi-qubit operations. In contrast, having bosonic hardware which natively realizes these gates facilitates a more natural and hardware-efficient implementation. Details aside, this matches our intuition: simulating bosonic modes with qubits introduces a sort of “mismatch”, while it is much more natural to simulate phenomena involving bosonic modes with qumodes, natively realized in hardware.

Below, we will give illustrative examples of how Bosonic Qiskit can be used as a development and co-design tool toward both of these contexts, and to furthermore give a sense for the workflow of Bosonic Qiskit. Code to reproduce these results, along with gate parameters for the GKP codeword preparation, can be found in a tutorial in the GitHub repository. One important preliminary is that, to incorporate qumodes into the Qiskit stack, “under the hood” each qumode is composed of an ensemble of qubits using a binary representation. This underlying representation is abstracted away at the level of gate and circuit-construction within Bosonic Qiskit, but is evident when using certain built-in Qiskit methods, such as circuit.draw() (as seen in Fig. 2). More details on the choice of encoding and its implications can be found in the preprint here.

Example: Preparation of code words

We now demonstrate two example circuits: one to probabilistically prepare a cat-state, and another to prepare the +Z finite-energy GKP codeword. In both cases, we require a single qumode and a single auxiliary qubit. We first demonstrate the preparation of a cat state:

where |±α⟩ corresponds to coherent states of opposite phase, 𝒩 is a normalization constant (which differs from two due to the fact that coherent states are not exactly orthogonal), and the parity (i.e., the relative phase ±), is determined by the outcome of measuring the auxiliary qubit.

The entire preparation algorithm can be described in three steps:

  1. Apply a Hadamard to the auxiliary qubit to prepare the state |+⟩
  2. Entangle the qumode and auxiliary qubit using the conditional displacement

3. Measure the auxiliary qubit in the X-basis (i.e., by applying a Hadamard and measuring in Z-basis)

Below, we demonstrate this simple preparation circuit in Bosonic Qiskit:

The circuit diagram and Wigner function plot are displayed in Fig. 2a.

As a second example, we will now demonstrate a circuit to prepare the +Z (finite-energy) GKP code word. More information about the gate sequence to prepare this non-trivial state can be found in Ref. [10]. In short, this is achieved by layering “echo-controlled displacements” (a controlled-displacement with an additional X gate on the qubit), and single-qubit rotations. The circuit diagram and resulting Wigner function are shown in Fig. 2b.

Figure 2: Bosonic Qiskit circuits and to prepare a (a) Cat state and (b) a finite-energy +Z GKP codeword (as used in Ref. [10]). Wigner quasiprobability distributions for the final qumode state is shown on the right in each case. For the cat state, its parity is probabilistically determined according to the measurement outcome of the auxiliary qubit, with even and odd parity corresponding to |0⟩ and |1⟩, respectively

Example: Simulation of the Bose-Hubbard model

We now turn to another example, this time with the goal of quantum simulation. In particular, we will focus on the Bose-Hubbard model, a paradigmatic testbed for quantum simulation (see, for example, Ref. [11]) that famously hosts a superfluid-to-Mott-insulator phase transition. In this toy model, each bosonic mode corresponds to a single site of a lattice. Bosonic particles then hop between neighboring sites at a rate J. Meanwhile, bosons are repulsed from each other according to the interaction strength U such that it is energetically unfavorable to occupy the same site. It is the competition between these two simultaneous effects that leads to a phase transition as the system is tuned from the limit where hopping dominates (J/U >>1, superfluid) to the opposite regime (J/U <<1, Mott-insulator).

The Hamiltonian of the Bose-Hubbard model is:

Here, ⟨i, j⟩ denotes summation over all neighboring lattice sites i and j, while aᵢ†(aᵢ) is the creation (annihilation) operators which increases (decreases) the occupancy at site i by one. To study the time evolution under this Hamiltonian, we need to implement the unitary time evolution operator e^-iHt (we have set ħ = 1). To achieve this, we rely on the Trotter formula:

Which allows us to approximate the full time evolution operator via alternation of:

Where H₁ and H₂ refer to the first (hopping) and second (interaction) term of H, respectively.

Below, we demonstrate a simple simulation of the 1D Bose-Hubbard model using Bosonic Qiskit. In particular, we use beamsplitters of the form:

to realize U₁, and use SNAP gates,

to realize U₂ (i.e., one can show aᵢ†aᵢ†aaᵢ = Σ_n (nᵢ(nᵢ — 1)|nᵢ⟩⟨nᵢ|) where n is the occupancy of site i, which enables synthesis of U₂ through application of SNAP for each {n,i} and appropriate choice of the phase θ_n).

Figure 3: Simulation of a four-site Bose-Hubbard model in Bosonic Qiskit, with hopping rate J and two-particle interaction strength U. We initialize the system such that two edge qumodes have two bosons each, and the intermediate qumodes are vacant. Here, we show the average particle number ⟨nᵢ⟩ as a function of time for various J/U

Example: Adding photon-loss

In addition to providing many common bosonic gates to implement unitary evolution of qumodes, Bosonic Qiskit also has built-in functionality for an especially important type of noise impacting bosonic hardware: amplitude damping (i.e., photon-loss). This is represented by the time evolution of the density matrix ρ according to the Lindblad master equation:

where the Lindblad “jump” operator is the annihilation operator a, with corresponding loss-rate κ (and possible unitary time evolution described by H). As a simple demonstration, below we add photon-loss to a Bosonic Qiskit circuit. In particular, we initialize a single qumode to the Fock state |3⟩, and apply a displacement gate concurrent with the amplitude damping noise channel. Bosonic Qiskit provides functionality to animate the evolution of the Wigner quasiprobability distribution, as shown in Fig. 4.

Figure 4: Animation of the Wigner quasiprobability distribution of a qumode (initialized to Fock state |3⟩) undergoing both displacement and an amplitude damping noise channel (photon loss).

Conclusion

In summary, hybrid qubit-bosonic platforms provide an intriguing alternative to the qubit-based model of a quantum computer. Our goal in developing Bosonic Qiskit is to enable the Qiskit community to learn about, simulate, and develop ideas toward this exciting research direction. While we have provided a few minimal examples illustrating use-cases of Bosonic Qiskit, we hope to see many more within the user community. We welcome any feedback as we continue to add new features.

This project was supported by the U.S. Department of Energy, Office of Science, National Quantum Information Science Research Centers, Co-design Center for Quantum Advantage under contract number DE-SC0012704

[1] Ofek, N., Petrenko, A., Heeres, R. et al. Extending the lifetime of a quantum bit with error correction in superconducting circuits. Nature 536, 441–445 (2016).

[2] Grimm, A., Frattini, N.E., Puri, S. et al. Stabilization and operation of a Kerr-cat qubit. Nature 584, 205–209 (2020).

[3] Hu, L., Ma, Y., Cai, W. et al. Quantum error correction and universal gate set operation on a binomial bosonic logical qubit. Nat. Phys. 15, 503–508 (2019).

[4] Z. Ni et al. Beating the break-even point with a discrete-variable-encoded logical qubit. arXiv:2211.09319 (2022)

[5] D. Gottesman, A. Kitaev, and J. Preskill, Encoding a qubit in an oscillator, Physical Review A, 64, 012310 (2001)

[6] Campagne-Ibarcq, P., et al. Quantum error correction of a qubit encoded in grid states of an oscillator. Nature 584, 368–372 (2020).

[7] Sivak, V. V., et al. “Real-time quantum error correction beyond break-even.” arXiv:2211.09116 (2022)

[8] See, for example, this write-up by Physics World.

[9] For a comparison between various encodings for quantum simulation, see the recent work by Sawaya, N.P.D., et al. Resource-efficient digital quantum simulation of d-level systems for photonic, vibrational, and spin-s Hamiltonians. npj Quantum Inf 6, 49 (2020).

[10] Eickbusch, A., Sivak, V., Ding, A.Z. et al. Fast universal control of an oscillator with weak dispersive coupling to a qubit. Nat. Phys. 18, 1464–1469 (2022).

[11] Greiner, M., Mandel, O., Esslinger, T. et al. Quantum phase transition from a superfluid to a Mott insulator in a gas of ultracold atoms. Nature 415, 39–44 (2002).

--

--

Qiskit
Qiskit

An open source quantum computing framework for writing quantum experiments and applications