<<

Software tools for quantum control: Improving quantum computer performance through noise and error suppression

Harrison Ball, Michael J. Biercuk,∗ Andre Carvalho, Jiayin Chen, Michael Hush, Leonardo A. De Castro, Li Li, Per J. Liebermann, and Harry J. Slatyer Q-CTRL, Sydney, NSW Australia & Los Angeles, CA USA

Claire Edmunds, Virginia Frey, Cornelius Hempel, and Alistair Milne ARC Centre for Engineered Quantum Systems, The University of Sydney, NSW Australia (Dated: July 4, 2020) Effectively manipulating hardware in the presence of imperfect devices and control systems is a central challenge in realizing useful quantum computers. Susceptibility to noise critically limits the performance and capabilities of today’s so-called noisy intermediate-scale quan- tum (NISQ) devices, as well as any future quantum computing technologies. Fortunately, quantum control enables efficient execution of quantum logic operations and quantum algorithms with built- in robustness to errors, and without the need for complex logical encoding. In this manuscript we introduce software tools for the application and integration of quantum control in quantum comput- ing research, serving the needs of hardware R&D teams, algorithm developers, and end users. We provide an overview of a set of python-based classical software tools for creating and deploying op- timized quantum control solutions at various layers of the quantum computing software stack. We describe a software architecture leveraging both high-performance distributed cloud computation and local custom integration into hardware systems, and explain how key functionality is integrable with other software packages and languages. Our presentation includes a detailed mathematical overview of central product features including a flexible optimization toolkit, engineering-inspired filter functions for analyzing noise susceptibility in high-dimensional Hilbert spaces, and new approaches to noise and hardware characterization. Pseudocode is presented in order to elucidate common programming workflows for these tasks, and performance benchmarking is reported for numerically intensive tasks, highlighting the benefits of the selected cloud-compute architecture. Finally, we present a series of case studies demonstrating the application of quantum control solutions derived from these tools in real experimental settings using both trapped-ion and superconducting quantum computer hardware.

CONTENTS C. Flexible optimization tools for quantum control 12 I. Introduction2 1. Flexible optimizer framework 12 2. Flexible optimizer features 13 II. Software architecture and integrations4 3. Optimizer performance benchmarking 16 A. Cloud-compute architecture4 D. Time-domain simulation tools for realistic B. Package overview4 hardware error processes 16 C. Compatibility with other programming 1. Technical details of simulation languages6 functionality 17 D. Integration with quantum hardware6 2. Simulation example 19 E. Hardware characterization 19 III. Technical functionality overview8 1. Noise spectral estimation 19 A. General quantum-control setting8 1. Optimal quantum control8 2. Hamiltonian parameter estimation 24 2. Robust quantum control9 3. Controllability9 IV. Quantum control case studies 26 B. Performance evaluation for arbitrary A. Open-loop control benefits demonstrated in controls 10 trapped-ion QCs 26 1. Modelling noise and error in D-dimensional B. Simultaneous leakage and noise-robust systems 10 controls for superconducting circuits 28 2. Multi-dimensional filter functions in the C. Robust control for parametrically-driven frequency domain 11 superconducting entangling gates 29 D. Experimental noise characterization of multiqubit circuits on an IBM cloud QC 32 E. Crosstalk-resistant circuit compilation 34 ∗ Also ARC Centre for Engineered Quantum Systems, The Uni- versity of Sydney, NSW Australia V. Conclusion and outlook 37 2

Acknowledgements 37 One of the earliest software methodologies proposed for quantum computing described a 4-phase design flow [8], A. Technical definitions 39 transforming high-level algorithms to mid-level represen- 1. Frobenius inner product and Frobenius norm 39 tations such as QASM (quantum assembly language), ul- 2. Fourier transform 39 timately to be compiled down to device-specific instruc- 3. Power spectral density 39 tions sent to the quantum hardware. Later work out- lined a more detailed layered architecture [9] including a B. Formal definition of the control Hamiltonian 41 pipelined control cycle from the application layer down 1. Generalized formalism 41 to the physical hardware layer, with mid-tier processes 2. Control solutions 41 such as QEC in between. 3. Control segments 42 Since then various QC programming languages, sim- 4. Generic shaped control segments 42 ulators, and compilers have been devised. Starting at 5. Control coordinates 43 the highest levels of the stack, freely-available examples include Quipper [10], a quantum program compiler im- C. Derivation of multidimensional filter functions 45 plemented in Haskell, the LIQUi simulator [11] writ- 1. Magnus expansion 45 ten in F#, and the ScaffCC compiler|i [12] designed for 2. Leading order robustness infidelity in terms of a C-style language, which compiles gate sets in QASM filter functions 45 and supports program analysis and low-level optimiza- tions. Further down the stack, efficient scheduling ar- D. Optimization benchmarking 47 chitectures with reduced communication overheads and 1. Optimization tools 47 increased parallelism have been proposed to accommo- 2. Software and hardware versions 47 date the relatively short lifetimes of 3. Physical systems 47 in quantum hardware [13–15]. Other compiler perfor- a. Single controllable in four-qubit mance gains have been identified by considering device- space 48 specific optimizations, gate set choices and communica- b. Linear array of Rydberg atoms 48 tion topologies [16]. E. Methods for experimental demonstrations of More recently a variety of Python-based languages quantum-control benefits 49 have been developed providing greater integration and 1. Quasi-static error robustness 49 functionality across various abstraction layers. Pro- 2. Suppression of time-varying noise 49 jectQ [17–20] is a toolflow to optimize, simulate and com- 3. Error homogenization characterized via pile quantum programs for different hardware backends. 10-qubit parallel randomized benchmarking 50 [2, 21] is a general-purpose compiler framework 4. Mølmer-Sørensen drift measurements 50 generating OpenQASM [22], the language used to cre- ate and compile quantum programs on IBM’s Quantum F. Visualizations of noise and control in quantum Experience [23]. pyQuil [4, 24, 25] generates Quil [24], circuits 51 the compiler language used for the Rigetti Computing system. Cirq [5] is Google’s software library for writing, References 52 optimizing and running quantum circuits on hardware backends or simulators. Nonetheless, the central impediment to realizing prac- I. INTRODUCTION tical, functional machines in the NISQ-era and beyond remains the influence of noise and error in quantum hard- The emergence of commercially-available quantum ware itself, despite these various advances in quantum computing (QC) hardware at the scale of a few tens of software development. Electromagnetic noise in its vari- has led to an explosion of interest in NISQ (noisy ous forms diminishes coherent lifetimes through the pro- intermediate scalable quantum) devices [1]. There are cess of decoherence, and reduces the fidelity of quan- even now several software stacks allowing end-users and tum logic operations when imperfect quantum devices software developers to explore quantum computing over are manipulated by faulty classical hardware. This crit- the cloud [2–5]. Commensurate with this growth in pro- ically limits the range of useful computations achievable gramming frameworks has been a expansion of efforts on quantum hardware, measured e.g. by circuit depth focused on application mapping and algorithmic devel- or quantum volume [26]. Overwhelmingly, the tools and opment to identify applications yielding any commer- frameworks introduced above focus on the design, imple- cially relevant computational advantage [6]. However, as mentation, and optimization of algorithms near the top in conventional software engineering, functionality and of the quantum computing software stack, and do not computational advantage ultimately rests on lower-level directly address this most fundamental challenge in the abstractions deeper in the computational stack such as field. compilers, and more fundamentally, on hardware device Developing techniques that improve the robustness of performance [7]. quantum hardware against noise and error is critical 3 for pursuing commercially-viable applications. One ap- 1 To advance the performance of real quantum hard- proach to this problem comes through the implemen- ware by delivering optimized control strategies. tation of low-level error-suppression strategies derived More concretely, to enable efficient characterization from the field of quantum control [27–36]. This disci- of error sources, identify and exploit system con- pline draws insights from classical control engineering - trollability, and generate instructions for real hard- frequently associated with the stabilization of unstable ware to suppress the influence of noise and imper- hardware - though successful translation to the quan- fection at the device level. tum domain requires modification of fundamental con- cepts. For instance, quantum systems used for quantum computing are typically nonlinear (control over qubits is 2 To deliver greater functionality from fixed quan- formally bilinear), noise-processes in real quantum hard- tum computational resources (measured in qubits, ware are generally colored, and measurement has strong gates, and compute runtime) for users with a back-action on the controlled system. broad-range of experience and expertise in quan- The existing literature on quantum control comprises tum computing hardware or quantum control. a wide range of complex techniques and diverse ap- proaches to achieve error robustness in quantum comput- ers [32, 37–51]. These strategies have been widely iden- 3 To provide maintained access to complex and tified as an important complement to algorithmic error- rapidly evolving technology, and deliver state-of- mitigation approaches such as QEC [9, 44, 52, 53], due the-art computational resources for numerically in- to their potential to improve resource-efficiency by re- tensive tasks via a modern cloud-compute architec- ducing physical-qubit error rates. Experimental demon- ture. This includes access to numerical techniques strations have validated the utility of quantum control in that benefit from or require specialized computa- mitigating noise in quantum hardware [54–59], leveraging tional hardware such as GPUs. longstanding insights from fields such as NMR [60]. Sim- ilarly, optimal control has begun to emerge as a powerful technique to manipulate complex Hilbert spaces [61–63], 4 To build cross-compatibility with existing work- or optimize experimental efficiency [64–66]. Early hints flows, programming languages, QC architectures, of progress moving beyond proof-of-principle demonstra- and access methods. These tools may be inte- tions towards system integration have emerged as well, grated into conventional programming workflows placing greater focus on real hardware limitations (e.g. via Python, linking them to research code, cloud- timing constraints, power and bandwidth limitations, based quantum computers, and custom QC hard- and availability of controls) [34, 49, 67–70], moving be- ware. yond single-qubit settings [71–74], and extending their applicability to realistic multi-qubit NISQ devices. The remainder of this paper is organized as follows. The diversity of quantum control techniques and First, we provide an overview of infrastructure software changing levels of hardware-knowledge among quantum products for the development and deployment of quan- computing end users highlight a need for a unified soft- tum control in quantum computers in Sec. II. We then ware framework supporting the integration of quantum move on to present a technical, mathematical treatment control techniques with both differing hardware systems of a novel quantum control capabilities we have developed and high-level software abstractions. Such an approach is and deployed in these packages in Sec. III. Our presen- strongly aligned with emerging community expectations; tation includes a detailed discussion of new algorithmic a prime indicator of this is the release of OpenPulse [21], approaches to: flexible numeric optimization using an the Qiskit language providing cloud access to IBM back- engine built in TensorFlow and linking to various quan- ends at the analog layer, motivated by the need “to ex- tum control tasks; performance evaluation and validation plore noise in these systems, apply dynamical decoupling using both numeric simulation and multidimensional fil- and perform optimal control theory”. However, a his- ter functions; and control-hardware characterization via toric reliance on customized local code for quantum con- noise spectroscopy and Hamiltonian parameter estima- trol tasks is cost-inefficient, harms reproducibility, fails tion. In Sec. IV these functionalities are demonstrated to deliver on the most up-to-date knowledge from the through a series of case studies tied to challenges in real research community, and has substantial negative conse- QC hardware. We provide experimental validation of quences as students and staff inevitably move on from the benefits of low-level quantum control in quantum current roles and support ceases. computing hardware, demonstrate novel numerically op- In this manuscript we introduce an infrastructure soft- timized gate solutions for multiqubit gates, extract pre- ware package aimed at addressing these challenges, fo- viously inaccessible information about noise sources in cused on providing access to state-of-the-art quantum cloud quantum computer hardware, and demonstrate the control techniques, and enabling integration into the impact of optimization at the circuit level for increasing quantum computing stack. These tools have been de- noise robustness. We conclude with a brief summary and signed to meet the following central objectives: future outlook of forthcoming feature developments. 4

II. SOFTWARE ARCHITECTURE AND price, performance and privacy. For instance, a remotely INTEGRATIONS managed on-premises-cloud instance allows full control over all sensitive data, while still ensuring the advantages The Q-CTRL infrastructure software suite is designed of a cloud-compute architecture. to improve hardware performance in the quantum com- Our choice of Python for the API incorporates speed puting stack through access to quantum control. Q- of development and support for collaboration with exter- CTRL tools incorporate the following general classes of nal developers, scientists, and partners. Both quantum quantum control capability relevant to stabilizing quan- scientists and programmers are typically familiar with tum systems against hardware errors: Python, having used its libraries for tasks ranging from instrument control and advanced numerics to web de- Error-robust control selection, creation, and inte- • sign. Building in Python also leverages compatibility gration into quantum hardware. with global resources of open-source code, and web-based Flexible optimization for quantum logic, circuits, frameworks like Django, bringing embedded security fea- • algorithms, and high-dimensional quantum sys- tures to safeguard against attacks such as SQL injection, tems, incorporating various constraints, nonlinear- request forgery, or cross-site scripting. ities, etc. In certain circumstances the Python API incorporates special-purpose programming frameworks such as Ten- Predictive error-budgeting and simulation of hard- sorFlow and Cython in order to deliver performance en- • ware and circuit performance in realistic laboratory hancements via access to cloud-based hardware infras- environments. tructure. In all cases, processing resources used in the execution of a computation are scaled by the software, Hardware tuneup, characterization, and calibra- • and specialized accelerators such as GPUs are automati- tion at the microscopic level to identify and off- cally accessed for tasks exceeding predefined thresholds of set sources of noise, imperfection, and performance computational complexity such as high-dimensional op- variability. timizations executed using our TensorFlow-based tools In this section we provide a brief introduction to the (see Sec. III C). cloud-compute architecture in use, key software packages, and integration with both other software tools and hard- ware systems. We then provide a technical discussion of B. Package overview the quantum control functionalities enabled by this soft- ware in Sec. III. Here we survey the the central software packages de- signed for the deployment of quantum control techniques in quantum computer hardware. Each delivers a targeted A. Cloud-compute architecture set of quantum-control capabilities to users with different backgrounds, interests, and objectives. Our core focus is All software is delivered via a cloud-compute architec- on solutions which integrate quantum control into the ture built around an application programming interface lowest level of the QC software stack, although quantum (API) coded in Python. Once the client has entered rele- control also provides benefits at higher levels as well, as vant inputs, this information is sent to the back-end and demonstrated in Sec. IV E. processed through the API. The client’s data is taken BOULDER OPAL offers a Python-based toolkit al- through to the Python module, which performs the rele- lowing users to develop and deploy quantum control in vant computations and outputs objects based on the sys- their hardware or theoretical research. All technical tem inputs. The interface with the API varies based on features and core capabilities of Q-CTRL packages de- the specific software in use as described in Sec. II B, and scribed in Sec. III are accessible via this package, making allows for custom application development by the user. this the core toolkit in our offering. In order to facili- A substantial proportion of the codebase comprises tate integration into conventional programming environ- orchestration of cloud-compute resources, data manage- ments, BOULDER OPAL includes a light Python pack- ment, memory management, and the like, though we will age wrapper that is downloaded locally and orchestrates focus primarily on the technical functionality of the core calls to the web API. All computationally intensive tasks python package here. The back-end software architec- remain the responsibility of the core computational en- ture employs established and lightweight web interfaces gine in the cloud. Typical users - academic and industrial (OpenAPI specifications, REST APIs and JSON), as well R&D experts and quantum hardware experts. as performant and scalable architectural designs such as BLACK OPAL helps users learn about quantum com- a three-tiered application with dedicated worker pools puting and quantum control in the NISQ era by taking and work queues. The use of open standards enables the advantage of a graphical interface with interactive visu- entire application stack to be deployed on any cloud— alizations. It is designed to assist in building intuition for public, private, hybrid or on-premises—allowing users to complex concepts such as the meaning of entanglement in determine appropriate and necessary tradeoffs between quantum circuits, or the impact of noise on circuit func- 5

FIG. 1. Relationships between Q-CTRL software packages, demonstration of various means of user interaction, and links between cloud-compute resources, interfaces, and quantum computing hardware. For instance, BOULDER OPAL connects to the cloud engine via the API, is commonly accessed through a Python interface, or may be combined with the last-mile- integration package to enable direct integration into user quantum hardware. FIRE OPAL is also accessed via a python package and interfaces with cloud quantum computers. Meanwhile core functionality may be accessed outside of these products either via the Q-CTRL API by users building custom tools, or directly via hosted Jupyter notebooks by Q-CTRL research partners. As a standalone open-source python package, Open Controls is not included on this architectural diagram. tionality. Features are delivered as a web-based API ser- ers and can provide deterministic error robustness with- vice providing users with a graphical front-end interface out the need for additional overhead such as repetition incorporating guided tours, configuration wizards, and when adding engineered error in zero-noise-extrapolation integrated help; examples of an interactive visualization schemes (see Sec. IV E for an example case study). Typ- for single and multi-qubit gates are shown in App. F. ical users - developers and end-users The front-end prepopulates common system configura- focusing on application mapping without detailed knowl- tions for superconducting and trapped-ion processors, or edge of the underlying hardware. custom configurations may be input, and contains prede- fined libraries of known control solutions. Typical users - students, conventional developers, and newcomers in Open Controls is an open-source Python package that quantum computing and quantum control. includes established error-robust quantum control proto- FIRE OPAL is a forthcoming package focused on em- cols from the open literature. The aim of the package bedding the benefits of quantum control into algorithmic is to be a comprehensive library of published and tested design and execution. Key functionality includes analy- open-loop quantum control techniques developed by the sis of algorithmic performance in the presence of realistic community, with export functions allowing users to de- time-varying noise, embedding of error-robust quantum ploy these controls on custom quantum hardware, pub- logic-operations into a compiled algorithm, and the in- licly available cloud quantum computers, or other parts tegration of control theoretic concepts such as robust- of the Q-CTRL software suite. Typical users - quantum ness through the structure of a compiled circuit. This research teams contributing to or employing community- toolkit is designed to be compatible with other compil- derived quantum control protocols and sequences. 6

C. Compatibility with other programming At its most basic level, integration into custom user languages hardware involves converting waveforms described in software into physical outputs from hardware signal gen- A typical mode of accessing the software packages de- erators such as arbitrary waveform generators (AWGs), scribed above comes from a lightweight Python wrapper direct digital synthesizers (DDSs), and vector signal gen- or SDK which enables access to the API from within erators (VSGs). BOULDER OPAL permits exporting a standard Python interface. This approach brings the controls in a format tailored to hardware constraints such added advantage of compatibility with a wide variety as sample rates, amplitude resolution, and data formats. of programming languages commonly employed in the Custom control pulses are exported into a format (e.g. quantum computing research community, as summarized CSV or JSON [21]) easily read by the experimental con- in Sec. I. Q-CTRL provides Python adaptors for all open- trol stack. Q-CTRL provides a range of pre-built for- source Python-based quantum computing languages, al- matting scripts to translate control output into machine- lowing integration of advanced control solutions into con- compatible formats. ventional programming workflows and execution on cloud As an example, Q-CTRL has partnered with Quan- hardware platforms. tum Machines, providing a direct interface between Q- The qctrl-qiskit convenience package provides export CTRL protocols and their Quantum Orchestration Plat- functions of Q-CTRL-derived control solutions or pro- form [75]. The Quantum Orchestration Platform is a tocols to Qiskit [2]. For instance, dynamical decoupling software-hardware solution whose software interface is sequences (used for implementing the identity operator in Quantum Machines’ programming language called QUA, preservation of ) can be converted into and an advanced hardware system allowing orchestration Qiskit quantum circuits using these methods, account- of QUA programs in real-time (e.g. waveform generation, ing for approximations made in Qiskit circuit compila- waveform acquisition, classical data processing and real- tion and ensuring circuits are not compactified in such a time control-flow). This integration naturally permits way that undermines performance. Furthermore, control control formatting matched to QUA, but also exploits pulses can be exported from BOULDER OPAL in the parametric encoding to enable rapid hardware tuneup OpenPulse format [21] which provides analog-level pro- and calibration. Similarly, scripting in QUA allows ex- gramming of microwave operations performed on hard- ploitation of low-latency FPGA-based computation for ware. As a complement, Q-CTRL has also developed cal- the execution of real-time machine-learning routines or ibration routines for IBM hardware employing the Open- Bayesian updates via tools offered jointly by Q-CTRL Pulse framework, again offered as convenience functions. and Quantum Machines. Using this framework we have Thus, appropriately formatted controls and calibration recently demonstrated dephasing-robust single-qubit op- routines can then run on IBM’s quantum computing erations in a tuneable device, indicating that hardware with an IBM Q account [23]. the combination of Q-CTRL software with the Quan- The qctrl-pyquil convenience package provides export tum Machines quantum orchestration platform stack per- functions to pyQuil [24, 25], and qctrl-cirq allows export mits faithful output of complex modulated control pro- Cirq [5]. At present, the absence of analog-level con- tocols. Beyond official Q-CTRL partners, custom scripts trol access limits export functionality to timed sequences cover commonly encountered hardware solutions, lever- of standard control operations handled natively in these aging the flexibility of Python programming. platforms. In both cases the translation layer ensures Moving further down the experimental control hard- that the integrity of the sequence structure and tim- ware stack it also becomes possible to implement a va- ing is preserved within approximations made in sequenc- riety of low-latency real-time processing tasks. Capa- ing in these two languages. pyQuil integration currently bilities are based on core routines and techniques cus- permits the execution of Q-CTRL-derived sequences on tomized for a user’s or vendor’s hardware system (e.g. quantum hardware provided by Rigetti’s Quantum Cloud QUA development with Quantum Machines). An ex- Service. ample is closed-loop optimization of control solutions in order to reoptimize error-robust controls as system noise sources drift or in the presence of unknown system re- D. Integration with quantum hardware sponses [54, 76]. Numerically optimized controls may be used as a seed for optimization based on experimental The software tools described above integrate with a measurements incorporating user-defined cost functions wide variety of hardware systems—from local laboratory- such as randomized benchmarking survival probabilities. based quantum hardware to quantum-compute cloud en- An essential aspect of this integration is efficient hard- gines ( Fig. 1). Both BOULDER OPAL and FIRE OPAL ware calibration permitting determination of the analog support integration into cloud-quantum computers us- voltages or digital commands required to achieve out- ing analog-layer access and/or appropriate convenience put signals with appropriate phase and amplitude (al- functions. However, a more powerful integration strategy ternatively I and Q) values. This helps account not may be pursued in the case of interfacing these software only for residual amplitude modulation in the presence tools with custom quantum hardware. of other forms of modulation (e.g. phase modulation), 7

FIG. 2. Schematic overview of quantum control functions and their integration into a user’s custom classical experimental control hardware. As tasks are abstracted further away from the operation of experimental hardware, the point of integration similarly rises in the experimental control stack. Functions are broadly characterized by their execution in either embedded or distributed computational hardware. but also cross-coupling and signal distortions encoun- ing decay rates. tered due to room-temperature hardware such as mixers. Hardware calibration can also leverage quantum control 5. IQ-nonlinearity calibration [83]. in order to gain access to information about signal distor- tions and transmission-line nonlinearities within experi- 6. Time [84] and frequency-domain impulse-response mental systems that are not easily characterized through characterization. conventional means. This approach is widely employed in most laboratories through basic protocols for qubit 7. Modulated spectroscopy for excited states. frequency determination such as Ramsey spectroscopy, drive-amplitude calibration through Rabi measurements, 8. Hamiltonian parameter estimation (e.g. control- and more advanced protocols to estimate microwave rotation-axis identification). phases [77] or identify quadrature cross-couplings [78, 79]. BOULDER OPAL currently offers a range of convenience These capabilities may be integrated into a user’s exist- tuneup functions for superconducting-circuits using tools ing experimental hardware control system and software described in Sec. III E: stack either manually or via the encapsulated Last-Mile Integration (LMI) extension for BOULDER OPAL. This 1. Resonator-probe pulse optimization. is delivered via a customized, local-instance Python pack- age that runs in parallel with the user’s experimental con- 2. Square-wave-frequency-modulation [80, 81] qubit- trol stack to automate and schedule key tasks in control resonance identification. definition, calibration, and optimization. The LMI is re- 3. State-discriminators using ML-based classifiers sponsible for the orchestration of critical tasks conduced (linear and gradient-boosting) [82]. across different hardware devices as shown in Fig. 2. The LMI package maximizes automation via a suite of 4. Maximum-likelihood state estimation incorporat- Python scripts for scheduling of essential tasks such as 8 hardware calibration and characterization. As an exam- 1. Optimal quantum control ple, the package permits scheduled noise sensing and re- construction in order to detect changes in dominant noise The optimal control setting reduces the following prob- power spectra. Again, all computationally intensive cal- lem. Given the Schr¨odingerequation culations are handled by the distributed cloud-compute engine (Fig. 1) with only scripting and experimental- iU˙ ctrl(t) = Hctrl(t)Uctrl(t) (2) control-software integration handled locally. Experimen- tal calibration and noise characterization results are also the aim is to find H (t) such that logged on the cloud server and accessible to users through ctrl a developer’s portal. Utarget = Uctrl(τ) (3)

where Uctrl(τ) is the evolved unitary at time τ and Utarget III. TECHNICAL FUNCTIONALITY is the target operation. This control problem, gener- OVERVIEW ally, can be considered a bilinear control problem as the controllable element of the equation of motion (Hctrl(t)) In this section we provide an overview of key techni- linearly multiplies the state. This is in contrast to the cal capabilities afforded by quantum control as accessed much more common linear control problems from clas- through the packages introduced in Sec. II. Our presen- sical control where the controllable element is linearly tation focuses on tasks relevant to driving performance added to the state. Bilinear control problems typically enhancement in quantum computer hardware, though do not have analytically tractable solutions, and instead many other applications exist in quantum sensing, data must be solved numerically. fusion, and advanced medical imaging. Alongside our for- We define a measure of optimal control using a Fro- mal mathematical treatment we incorporate pseudocode nenius inner product Eq. A1 to evaluate the operator- to illustrate how this functionality is embodied in soft- distance between Uctrl(τ) and Utarget. Specifically ware features. 1 2 optimal(τ) = Utarget,Uctrl(τ) . (4) F D F

A. General quantum-control setting D E

This measure is bounded between [0, 1], with perfect Here we establish the general control-theoretic setting implementation of the target Eq. 3 corresponding to for the creation of control solutions in multi-dimensional optimal(τ) = 1. We define a corresponding infidelity quantum systems. We write the total Hamiltonian as measureF as the sum of dynamical contributions from both control and noise interactions (τ) = 1 (τ). (5) Ioptimal − Foptimal Htot(t) = Hctrl(t) + Hnoise(t). (1) A simple modification of this fidelity measure enables the optimal condition to be evaluated on a subspace of We assume that Hctrl(t) is a deterministic component interest. Specifically of Htot(t) containing both an intrinsic drift term (e.g. the frequencies of the qubits) and controllable parts 2 P 1 of the system (e.g. microwave drives or clock shifts). optimal(τ) = PUtarget,Uctrl(τ) (6) F Tr (P ) F See App. B for generalized definitions of these terms. D E The error Hamiltonian H (t) captures the influence noise where P defines a projection matrix, enabling optimal of noise, is assumed to be small, and may also be a func- control to be evaluated on a target subspace. Similarly, tion of control Hamiltonian H (t). The typical control ctrl achieving high-fidelity state-transfer ψ ψ problem may be split into two distinct tasks: initial final is equivalent to maximizing the state| fidelityi defined → | asi 1. Design a control solution for a D-dimensional ψ (τ) = ψ U (τ) ψ . (7) Hilbert space such that Hctrl(t) implements a tar- Foptimal |h initial| ctrl | finali| get unitary Utarget at time τ. As discussed in detail in Sec. III C, crafting numeric so- 2. Design a control solution such that Hctrl(t) is robust lutions for these control problems may be conveniently against noise interactions Hnoise(t) over duration cast as cost-minimization; we provide specific numeric [0, τ]. tools addressing this challenge. These measures strictly describe whether the ideal Hamiltonian Hctrl implements The first task is typically referred to as an optimal con- the target evolution. They do not incorporate errors aris- trol problem while the second is called robust control; ing from stochastic noise processes. This is the subject Q-CTRL provides tools for both. of robust control, described below. 9

2. Robust quantum control As above, a simple modification of this measure enables the robustness condition to be evaluated on a subspace The robust control setting presents the multi-objective of interest. Specifically problem of achieving both tasks 1 and 2. In this case we 2 consider the stochastic evolution of the total Hamiltonian P 1 ˜ robust(τ) = P Unoise(τ), I (16) F Tr (P ) F Htot(t) * + D E ˙ iUtot(t) = Htot(t)Utot(t). (8) where P defines a projection matrix, enabling robust con- trol to be evaluated on a target subspace. And again, Noisy dynamics contributed by H (t), therefore dis- noise finding a robust control for a state transfer problem may tort the final operation U (τ) away from the ideal tot be expressed Uctrl(τ). This effect may be isolated by expressing the total propagator as ψ (τ) = ψ U˜ ψ . (17) Frobust h|h initial| noise| initiali|i ˜ Unoise(τ) = Utot(τ)Uctrl(τ)†. (9) Note Eq. 14 does not include any information about whether Uctrl(τ) implements a particular target gate The residual operator U˜noise(τ) defined in Eq. 9 is referred to as the error action operator. This unitary satisfies Utarget. In this sense, the robustness criterion is target- the Schr¨odingerequation in an interaction picture co- independent. Once again, solving these conditions re- rotating with the control, which we call the control frame. quires a numerical approach subject to a multiobjective Specifically, optimization routine. In practice, with sufficient control, it is always possible to satisfy both of these conditions τ and find a robust control that achieves the desired target U˜noise(τ) = exp i H˜noise(t)dt (10) T − 0 operation with high fidelity. We tackle this problem us-  Z  ing a number of novel approaches developed in Sec. III C, where is the time-ordering operator, and T and demonstrated in real case studies in Sec. IV B. H˜ (t) U (t)†H (t)U (t) (11) noise ≡ ctrl noise ctrl defines the control-frame Hamiltonian. An analogous 3. Controllability concept originally appeared in average Hamiltonian the- ory developed for NMR [85], but was called a toggling The number of controls required for complete control frame in that context because it considered only instan- of a quantum system has previously been studied by taneous operations. Schirmer et. al [86]. When the controls are assumed ˜ Using the definition of Unoise(τ) in Eq. 9, the robust to have unlimited bandwidth and power, the controlla- control problem may be formalized in terms of the dual bility of a quantum system can be determined by the conditions Lie algebra generated by the control operators. If the Lie algebra generated by the controls spans the Hilbert Utarget = Uctrl (12) space, the system is completely controllable. This result ˜ Unoise = I (13) means, in some cases, far fewer controls are required to control a quantum system than the Hilbert space. Con- where I is the identity operation on the control system. The robust control problem therefore consists of aug- sider a quantum system of m qubits in a Hilbert space of dimension n = 2m. Let there be 2m single-qubit con- menting the optimal control problem with the additional x y condition Eq. 13, describing how susceptible the system is trols of the form σi , σi for each qubit i 1, . . . , m . Additionally, let there be m(m 1)/2 two-qubit∈ { controls} to noise interactions under a given control Hamiltonian. − x x We define the corresponding measure defined by coupling interactions of the form σi σj for each qubit pair (i, j). The total number of available controls 2 therfore comes to L = m(m + 3)/2. It can be shown that 1 ˜ robust(τ) = Unoise(τ), I , (14) F D F the Lie algebra generated by this set of control opera- * + D E tors spans SU(n). The number of controls required for where the outer angle brackets denote an ensemble av- complete controllability of this system therefore scales as erage over realizations of the noiseh·i processes, and the in- (log (n)2/2) < (n2). O 2 O ner angle brackets , F denotes a Frobenius inner prod- When the controls have limited bandwidth, time, and uct, defined by Eq.h· A1·i. Robustness is therefore evaluated power the number of controls required for complete con- as the noise-averaged operator distance between the er- trollability can no longer be addressed analytically. An ror action operator Eq. 9 and the identity. This mea- upper bound is set by n2 1, the number of genera- − sure is bounded between [0, 1], with the robustness con- tors of the Lie algebra for SU(n)(e.g. all Pauli opera- dition Eq. 13 perfect implemented when robust(τ) = 1. tors for a single-qubit). In real quantum systems, how- We define a corresponding infidelity measureF as ever, the available controls comprise a subset of all possi- ble controls, including only such interactions as are sup- (τ) = 1 (τ) (15) Irobust − Frobust ported by the system architecture or control hardware. 10

With these device-dependent limitations in mind, it is Hamiltonian in Eq. 1 have control and error terms of the not straightforward to make claims about how the num- form ber of required controls scale with the system dimension. n The level of controllability must be made by account- H (t) = α (t)C , (19) ing for the particular noise processes being targeted, the ctrl j j j=1 available controls supported by the system, and the lim- Xp itations on evolution time imposed by e.g. decoherence H (t) = β (t)N (t). (20) timescales. These are important considerations for pro- noise k k k ducing realistic control solutions for physical devices. X=1

The control Hamiltonian, Hctrl(t), captures a target evo- lution generated by n participating control operators, B. Performance evaluation for arbitrary controls Cj . The noise Hamiltonian, Hnoise(t), captures in- teractions∈ H with p independent noise channels. Distor- The evaluation of any measure for the fidelity of a tions in the target evolution are generated by the noise robust-control operation as in Eq. 14 requires the com- operators Nk(t) , formally time-dependent such that ∈ H putation of Eq. 10, which is generally challenging as con- Nk(t) = 0 for t / [0, τ]. The noise fields βk(t) are as- trol and noise Hamiltonians need not commute at dif- sumed to be a classical∈ zero-mean wide-sense stationary ferent times. Characterizing control robustness and per- processes with associated noise power spectral densities formance in realistic laboratory settings—especially for Sk(ω). The control-frame [33, 88] Hamiltonian takes the operations performed within large interacting systems— form therefore requires simple, easily computed heuristics that p aid a user in gaining intuition into control performance. ˜ ˜ Here we introduce generalized multi-dimensional filter Hnoise(t) = βk(t)Nk(t) (21) k functions which serve as an engineering-inspired heuristic X=1 to determine noise susceptibility for arbitrary unitaries where within high-dimensional Hilbert spaces. These objects express the noise-admittance of a control as a function N˜k(t) Uctrl†(t)Nk(t)Uctrl(t) (22) of noise frequency, and reduce control selection to the ≡ examination of an easily visualized object similar to the defines the noise operators in the control frame. Using a Bode plot in classical engineering. Noise may be con- Magnus expansion as in Eq. 18, the noise action operator sidered over a wide range of parameter regimes, from may then be approximated to the desired order. quasi-static (noise slow compared to Hctrl(t)) to the limit For the purpose of calculating the error action op- in which the noise fluctuates on timescales comparable erator Eq. 10 we are free to choose any gauge trans- to or faster than Hctrl(t). We build on past single- ˜ ˜ formation of the form Hnoise0 = Hnoise + gI which, up qubit studies [33, 43, 46, 58, 87], assuming quasi-classical to a global phase, leaves the the dynamical evolution noise channels, to produce an explicit basis independent unchanged. With this freedom it is convenient to de- computational form incorporating all leading-order filter fine the transformed Hamiltonian with the property that functions and extensible to higher-dimensional quantum ˜ Tr(P Hnoise0 ) = 0, namely tracelessness on the subspace systems [88] with enhanced computational efficiency. associated with the projection matrix P , by choosing g = Tr(P H˜ )/Tr(P ). From Eq. 21, using the linear- − noise ity of the trace and observing the noise variables βk(t) 1. Modelling noise and error in D-dimensional systems are scalar-valued for classical noise, we obtain

The error action operator U˜ (τ) for non-dissipative p noise ˜ ˜ system-bath dynamics is treated as the unitary generated Hnoise0 (t) = βk(t)Nk0 (t) (23) (eff) k by an effective Hamiltonian H = Φ(τ)/τ, such that X=1 where we define the traceless noise operators in the tog- iΦ(τ) ∞ U˜ (τ) e− , Φ(τ) Φα(τ). (18) gling frame as noise ≡ ≡ α=1 X Tr P N˜k(t) We obtain an arbitrarily accurate approximation for the ˜ ˜ Nk0 (t) Nk(t) I. (24) unitary evolution using a Magnus series expansion [89, ≡ − Tr (P )  90]. where the αth Magnus term, Φα(τ), is computed as the sum of time-ordered integrals over permutations Assuming the noise fields βk(t) are sufficiently weak, of αth-order nested commutators of H˜noise(tj), for j we truncate the Magnus expansion Eq. 18 at leading or- 1, ..., α (see App. C 1). ∈ der and approximate the error action operator as { Consider} an arbitrary D-dimensional quantum system ˜ defined on the Hilbert space , and let the total control Unoise(τ) exp[ iΦ1(τ)]. (25) H ≈ − 11

Substituting into Eq. 16 the leading-order infidelity mea- 2. Multi-dimensional filter functions in the frequency sure for robust control is approximated as domain

1 In order to efficiently compute Magnus contributions (τ) Tr P Φ (τ)Φ†(τ) . (26) Irobust ≈ Tr (P ) 1 1 to the infidelity we move to the Fourier domain, and re-  D E express contributions to error in a D-dimensional system

To obtain this expression we perform a Taylor expan- p sion on Eq. 25, retain terms consistent with the leading- ∞ dω Φ (τ) = Gk(ω)βk(ω) (28) order approximation, and use the inherited property 1 2π k=1 Z−∞ from Eq. 24 that Tr(P Φ1) = 0 (see App. C 2). X To compute the first order Magnus term we substi- where the Fourier-domain functions tute Eq. 23 into Eq. C1, yielding Gk(ω) F Nk0 (t) ( ω) (29) p ≡ { } − βk(ω) F βk(t) (ω) (30) ∞ ˜ ≡ { } Φ1(τ) = dtβk(t)Nk0 (t) (27) k=1 are defined according to the conventions set out in Eq. A5 X Z−∞ and Eq. A5. where we formally extend the limits of integration to , Substituting Eq. 28 into Eq. 26 then yields a compact ±∞ noting that Nk0 (t) = 0 for t / [0, τ]. expression for the leading-order robustness infidelity in ∈ the frequency-domain

p 1 ∞ (τ) dωFk(ω)Sk(ω) (31) Irobust ≈ 2π k X=1 Z−∞ Here, each noise channel k contributes a term computed as an overlap integral between the noise power spec- trum Sk(ω) and a corresponding filter function, Fk(ω). An approximation to the inclusion of higher-order Mag- nus terms for the infidelity may be obtained by expo- nentiating this expression, due to the similarity of the power-series expansion for an exponential function and the structure of the Magnus series [58]. The critical element for capturing the action of the con- trol is the filter function, Fk(ω), relative to the kth noise channel. The explicit form of the filter function with re- spect to the projection matrix P is defined (see App. C for details) as 1 Fk(ω) = Tr PGk(ω)G† (ω) . (32) Tr (P ) k   This expression may be simply recast in a form that is easily computed numerically, an essential task in software implementations. Let pl be the lth diagonal element of P , then the filter function may be expressed

D D 1 2 Fk(ω) = pl Gk(ω) . (33) Tr (P ) lq l=1 q=1 FIG. 3. Overview of the action of control as a noise filter X X h i at the operator level. Upper: An example of how colored That is, take the Fourier transform of each matrix el- noise enters expressions for the infidelity of a control opera- ˜ tion as the overlap integral of the noise power spectrum and ement of the time-dependent operator Nk0 (t), sum the filter function for the control. A colored spectrum is thus complex modulus square of every element, weighted by whitened by the control through the physics of coherent av- the diagonal elements pl, and divide through by Tr(P ), eraging. Lower: Example filter function for an appropriately the dimension of the quantum system subspace. With constructed noise-suppressing/filtering control. Such filters this definition, we enable the efficient calculation of fil- are low-frequency-noise suppressing; by reducing the filter ter functions for single and multi-qubit gates, arbitrary function magnitude in a spectral range where the noise power high-dimensional systems, and complete circuits com- spectrum is large, the fidelity of the operation is improved. posed of multiple qubits and many operations. Thus we 12 have a new computational device allowing the calcula- C. Flexible optimization tools for quantum control tion of noise susceptibility for a wide range of elements relevant to quantum computation. An example applica- Precise manipulation and characterization of quan- tion of this computational technique to the evaluation of tum systems has emerged as a key area of development noise susceptibility got a user-defined control, as realized for quantum physics and chemistry. In most settings - in BOULDER OPAL, is presented in Algo. 1. whether addressing questions of unitary-control in high- Given a noise power spectral density which represents dimensional Hilbert spaces or implementing Hamiltonian realistic time-varying noise for a target noise operator parameter estimation - key tasks rapidly become analyti- (e.g. dephasing σz), one may use the filter function ∝ cally intractable and require the use of numeric optimiza- to simply estimate operational fidelity; the net fidelity is tion techniques. We have developed a versatile optimiza- given by the overlap integral of these two quantities as a tion engine (the optimizer) based on a GPU-compatible function of frequency (Fig. 3). A high-fidelity control will graph architecture coded in TensorFlow, compatible with minimize the filter function’s spectral weight in frequency (but not limited to) the efficient computational heuristics ranges where the noise power spectral density for a par- introduced in Sec. III B. ticular error channel is large. The predictive capabili- This toolkit enables rapid creation of high-fidelity uni- ties of this technique to control performance evaluation tary operations spanning both optimal and robust con- are experimentally validated for both single-qubit opera- trol in high-dimensional Hilbert spaces. Creation of an tions [58] and higher-dimensional systems (e.g. Mølmer- optimized control solution may be undertaken for indi- Sørensen gates [73]). An example of the predictive power vidual gates, small interacting subcircuits, or complete of the filter function is presented in Fig. 8d,e for a variety algorithms. All such circumstances are efficiently incor- of single-qubit controls. porated using the system definition introduced here with- out the need for a change in the underlying toolkit. Algorithm 1 Filter function (FF) Beyond broad applications in the optimization of uni- {f} ← {f1, ..., fn} . Arbitrary frequencies to evaluate FF tary operations, the optimizer has emerged as a versa- Hctrl(t) ← control Hamiltonian . Eq. B1 tile tool used throughout the software packages described N (t) ← dynamical noise operator . kth noise process k in Sec. II. For example, in Sec. III E we present an algo- P ← projection matrix τ ← duration of control rithm for noise spectral estimation based on convex op- m ← samples timization. The convex optimization procedure in this function FilterFunction({f}; Hctrl,Nk ) . Abb. FF algorithm may be implemented using the flexible opti- {Hctrl,1, ..., Hctrl,m} ← Sample(Hctrl(t), τ, m) mization engine, simply by expressing the convex objec- {Nk,1, ..., Nk,m} ← Sample(Nk(t), τ, m) tive function in terms of TensorFlow operations. The Uctrl ← I same tools are also used for Hamiltonian parameter esti- for i ∈ {1, ..., m} do mation discussed in Sec. III E 2. Here the computational ˜ † Nk,i ← UctrlNk,iUctrl . Eq. 22 task is to identify system parameters given a set of in- ˜ ˜ 0 ˜ Tr(P Nk,i) put controls. This problem reduces to optimization of an Nk,i ← Nk,i − Tr(P ) I . Eq. 24 objective function that maps candidate parameter values Uctrl ← exp [−iHctrl,i∆t] Uctrl . ∆t = τ/(m − 1) end for to the deviation between expected and measured system ˜ 0 ˜ 0 ˜ 0 {Nk} ← {Nk,1, ..., Nk,m} . t-domain: Eq. 24 response. These simple examples demonstrate the flex- ˜ 0 {Gk} ← DTFT({Nk}, ∆t, {−f}) . f-domain: Eq. 29 ibility and value of the optimizer engine across a wide for Gk,ν ∈ {Gk} do range of tasks. 2 1 PD PD h i A technical description of the essential framework is Fk,ν ← Tr(P ) l=1 pl q=1 Gk,ν . Eq. 33 lq presented below, covering the structure of the core op- end for timization engine, parameterization of control variables, Returns {Fk,ν } ← {Fk,1,...,Fk,n} definition of cost functions, and efficient incorporation end function of a wide range of constraints. In Sec. IV we demon- ...... strate these capabilities using higher-dimensional super- function Sample(A(t), τ, s) A(t): array-valued function of time conducting systems as important case studies. ti ← i∆t for i ∈ {0, ..., s − 1}, ∆t = τ/(s − 1). Returns {A(t0), ..., A(ts−1)} end function 1. Flexible optimizer framework function DTFT({A}, ∆t, {f}) {A}: samples of array-valued function, A(t) . length s. Mathematically we define the optimization problem as ∆t : time step between samples follows. Let C(v) denote the cost function for optimiza- {f}: arbitrary frequencies . length n tion, where v = (v1, v2, ...) denotes an array of general- Returns discrete-time Fourier transform of {A} at {f} ized control variables. The framework enforces no addi- end function tional structure on the cost function. To benefit from gradient ascent methods it is necessary to calculate all 13 partial derivatives of the gradient function Optimizer Functional form: Description cost type cost Cµ(v) ∇~ C = ∂C , ∂C ,... . (34) v ∂v1 ∂v2 Noise-free target unitary Optimal I  optimal over D-dimensions In general calculating ∇~ vC is a complex computa- tion requiring many applications of the chain rule, with Quasi-static noise/ Robust 1 F (0) strong dependence on the specific form of the cost func- 2π k constant-offset tion. These difficulties are naturally overcome, however, using TensorFlow as the optimizer framework. This ben- 1 Fixed frequency noise Robust Fk(ω) efits from an in-built gradient calculator based on the 2π suppression at ω underlying tensor map, and machine-learning algorithms R ω2 dω Broadband noise for minimizing the cost-function. Moreover, TensorFlow Robust Sk(ω)Fk(ω) 2 ω1 π suppression over [ω1, ω2] permits the calculation of nonlinear gradients. This is particularly relevant for systems where modulation of TABLE I. Component cost functions to be included as de- a given control variable does not simply modulate the sired in Eq. 35 for an optimization task. Here Fk(ω) and associated Hamiltonian term linearly. For example, a Sk(ω) are the filter function and noise power spectral density parametrically-driven entangling gate for superconduct- respectively, associated with the kth noise channel. ing transmon qubits is implemented by modulating a flux drive in the lab frame, mapping to an interaction in the quantum system with effective coupling strengths func- the internally-defined convenience methods. As a result tionally dependent on Bessel functions (see Eq. 81)[91– these steps can be implemented efficiently and the code 93]. written by the user can be focused on describing the The optimizer naturally benefits from these advantages specific system under consideration, rather than imple- by programming in TensorFlow, however we do not em- menting general-purpose algorithms. Importantly, these ploy in-built TensorFlow optimization routines; the op- convenience methods do not constrain the types of cost timizer is custom-built. In order to perform optimiza- function that can be represented; where a convenience tions, controls must be parameterized and cost functions method does not exist, arbitrary TensorFlow operations defined; the mappings v C(v) and v ∇~ vC are then may be used instead. See Table I for examples of im- passed directly into standard7→ gradient-based7→ optimiza- portant functional descriptions of commonly used cost- tion algorithms, for example L-BFGS-B [94]. To support function components. the general goal of multi-objective optimization, various These convenience methods, or building blocks, are cost metrics may be combined in a linear combination designed around three primary data types: tensors (pure multi-dimensional arrays of numbers), piecewise- C(v) = wµCµ(v), (35) constant (PWC) scalar-valued functions of time, and µ PWC operator-valued functions of time. Starting from X the raw control variables v, which are tensors, a repre- where each component Cµ(v) measures a distinct aspect sentation of the target system and cost function can be of the target performance as a function of the control built by applying a chain of these methods. variables v, and the constants wµ weight the relative im- A major consideration in the application of control is portance of these contributions in the optimized result. the generation of solutions that are practical to imple- This capability will be exploited in the implementation ment on real hardware, which motivates the inclusion of the features described next. of features which effectively constrain the optimization procedure. Limiting the search space via implementa- tion of appropriately constructed constraints can assist 2. Flexible optimizer features in ensuring that controls meet hardware limitations, and also dramatically improve the general efficiency of the The Q-CTRL optimizer, in addition to providing the optimization problem. Such constraints may be natu- infrastructure required for linking a user-defined Tensor- rally incorporated into the optimization framework via Flow cost function with a gradient-based optimization the definition of the cost function, as shown in Table I. algorithm, provides a collection of convenience methods We have focused on providing a range of convenience for automatically building the critical parts of the cost methods to model constraints that meet the demands function. These methods abstract away the low-level de- imposed by physical hardware limitations (see Table II). tails of common but non-trivial computations (for ex- These methods allow any combination of constraints to ample efficient numerical integration of the Schr¨odinger be incorporated into the description of the system when equation), allowing the cost function to be composed creating the cost function. from higher-level intuitive “building blocks”. This de- One of the most important constraints to be consid- sign encapsulates the details of frequently employed yet ered is smoothing of control waveforms to accommodate complicated steps of the cost-function calculation within bandwidth limits and finite response times from hard- 14

Optimizer convenience feature Technical details

A “smooth” waveform may be obtained via one of multiple methods: Smooth controls: (i) Limiting the effective time-derivative for any signal, The temporal variation in a control |α(τi) − α(τi−1)| < (δα)max. waveform is bounded to limit (ii) Composing candidate control waveforms as superpositions in a basis discontinuous transitions requiring high (Fourier, Slepian [95], etc) before discretized sampling (CRAB). bandwidths. (iii) Passing non-smooth waveforms through filters prior to inclusion in the Hamiltonian (see below).

Discrete high-bandwidth pulses may be transformed into filtered waveforms using arbitrary linear time-invariant filters such as RC filters with specified high-frequency cutoff, ω , a sinc window function, or user-defined filters. Filtered controls: max The transformed waveform enacts the optimized control, and can include the Control pulses are transformed by a time-discretization ultimately required for output on hardware, ensuring the linear-time-invariant filter. sampled waveform remains optimized. Alternatively, the effect of known filters on control lines can be incorporated into the system definition, in order to find optimized controls that compensate for the effect of the filters.

Symmetrized controls: Controls can be simplified via temporal symmetrization in order to produce Control pulses are temporally waveforms which comprise half of the desired number of segments. In certain symmetrized about the midpoint of the cases this may improve the overall efficacy of the desired solution. control.

Hard bounds may be enforced on any control variables. In particular, these Bounded-strength controls: bounds may be used to constrain the maximum value of signal waveforms, The magnitude of a pulse waveform may such that be limited to ensure optimized solutions |α(t)| ≤ α do not exceed physically motivated max where α(t) is some signal of interest and α defines its maximum (positive) bounds. max permissible value.

Fixed-control waveforms: Pulse waveforms need not be functions of the control variables, and instead For any individual control, the pulse may be specified by fixed values. This functionality enables support for waveform may be held fixed and systems with time-dependent terms that should not be tuned by the effectively frozen out of the variational optimizer (for example if they cannot be accessed by the control hardware). search.

In certain physical systems it is not possible to implement all controls Concurrent vs interleaved controls: simultaneously. This constraint involves transforming the optimization Control pulses on different drives and variables as v → v · b, where b is a binary mask enforcing the required shifts are executed sequentially or structure of interleaved operations. For b set to unity, controls may be simultaneously. applied concurrently.

TABLE II. Optimization features captured through convenience functions available in the package. See Ref. [96] for example code and Algo. 2 for an example implementation. ware. In general, smoothed solutions can be achieved rates an RC-filter for the pulse waveform is highlighted through a number of supported techniques such as con- in Fig. 11d. Importantly, as smoothed waveforms are straining the effective time-derivative of the control, or eventually discretized in time for output on arbitrary ensuring that all optimized waveforms incorporate linear waveform generators, the optimizer can include tempo- time-invariant filters such as RC or sinc function. For ral discretization in order to ensure the optimal gate is example, as shown in Algo. 2, a band-limit constraint produced by the sampled waveform. can be implemented simply by introducing a transfor- mation on the signal prior as part of the cost function. Another challenge faced in almost any quantum con- Another example in which such a transformation incorpo- trol problem is numerical integration of the Schr¨odinger equation to calculate the time evolution of the system. 15

In our framework, this integration forms a step in the Algorithm 2 Sample optimization cost-function calculation like any other, and may thus be function SampleCostFunction(v) customized by the user in order to best meet the de- τ ← total duration mands of their particular optimization problem. The ωcutoff band-limit for pulse framework offers several built-in GPU-optimized inte- m ← number of optimizable pulse segments gration routines, based on matrix exponentiation (for Utarget ← target gate piecewise-constant controls) and Runge-Kutta integra- α0(t) ← PwcScalar(τ, v) tion (for smooth controls or large systems for which full K(t) ← SincKernel(ωcutoff) α(t) ← LtiFilter(α0(t), K(t), m) exponentiation is infeasible). For instance, one may con- α(t)σ ← PwcOperator(α(t), σ ) sider a waveform distorted by a transmission line with a x x H(t) ← α(t)σx well-characterized response function. This response may C ← OptimalCost(H(t),Utarget) be incorporated into the optimization using Runge-Kutta Returns C, {α(t)} integration such that the transformed waveform still pro- end function vides optimal dynamics at the quantum hardware. Such approaches and the associated convenience functions are procedure SampleOptimization particularly valuable in the Hamiltonian parameter esti- C(v), {α(t)(v)} ← SampleCostFunction mation routine employed in Sec. III E. voptimized ← Optimize(C(v)) αoptimized(t) ← α(t)(voptimized) Returns {αoptimized} . optimized, band-limited control end procedure Finally, we also offer a CRAB-type [97, 98] optimiza- ...... tion in which a waveform is selected from a superposition in a user defined basis and discretized in time. Such a Built-in methods for building and optimizing cost representation fits naturally into our framework, where functions: waveforms may be represented as arbitrary functions of function PwcScalar(τ, α) control variables. This approach truncates the effective Returns PWC scalar α(t) taking value αi on segment i search space by limiting it to the associated Fourier co- end function efficients, and is therefore independent of the granularity of the piecewise-constant discretization. The optimizer function SincKernel(ωcutoff) contains a flexible CRAB implementation that allows a Returns kernel K(t) for a sinc filter with ωcutoff variety of CRAB techniques (e.g. bases with randomized end function frequencies, fixed frequencies, optimizable frequencies, or user-defined bases [95]). function LtiFilter(α(t), K(t), m) Returns m-segment PWC discretization of (α ∗ K)(t) end function

All of these features fit into the flexible optimization function PwcOperator(α(t),A) framework presented above, and may thus be arbitrar- Returns PWC operator A(t) = α(t)A ily combined to produce optimizable models of a wide end function variety of systems. Further description of the imple- function PwcOperatorSum({Al(t)) mentation of these features are provided in Table II, P Returns PWC operator A(t) = l Al(t) and detailed code-based demonstrations are available on- end function line [96].

function OptimalCost(H(t),Utarget) Returns Ioptimal for Hamiltonian H(t) and target Utarget end function As a concrete example we consider the creation of an optimized unitary operation manipulating a qubit. In function QuasiStaticRobustCost(H(t), {Nk(t)}) a standard optimal control context, one typically seeks P 1 Returns filter function values k 2π Fk(0) to minimize a single noise-free fidelity metric. Here, the end function control variables parameterize the control Hamiltonian Hctrl(v), such that the cost function obeys the functional function Optimize(C(v)) dependency C(v) = C (Uctrl(v, τ)), where Uctrl(v, τ) is Returns optimized values of v the evolved unitary after time τ. To produce optimized end function controls that account for the impact of noise, however, one must introduce additional terms in the cost function ... to penalize controls that achieve a high-quality gate in a manner that is not robust to noise. Similarly, the defi- We provide an algorithmic example of such an opti- nition of the cost function may include other constraints mization task for a single-qubit unitary in Algo. 2, in as articulated above. which we construct the cost function for realizing a band- 16 limited optimized control pulse. First, the raw control Q-CTRL (local) variables can be converted to a PWC scalar, represent- a

ing a (non-band-limited) control signal, by using the con- (s) trol variables as the per-segment scalar function values. Then, this raw signal can be convolved with a sinc filter kernel with a specific cutoff frequency, and re-discretized to a PWC scalar. This new signal is band-limited, and discretized in order to be implementable on real hard- ware. Next, the new signal is multiplied by a constant op- erator to represent a full Hamiltonian term. If necessary, multiple Hamiltonian terms can be similarly constructed, and summed to yield the overall Hamiltonian. Finally, the optimal cost is computed for the given Hamiltonian and target gate (see Table I for alternative costs). This cost function may then be passed to the optimizer, and b

the discretized band-limited signal extracted from the op- (s) timized system. Importantly, it is this band-limited sig- nal that defines the optimized gate, and therefore the evaluation of the cost function—the initial non-band- limited signal is used merely as an intermediate step be- tween the raw control variables and the signal of interest.

3. Optimizer performance benchmarking

In addition to application flexibility, the Q-CTRL opti- mizer provides advantages in time-to-solution. As shown in Fig. 4, in head-to-head performance benchmarking of FIG. 4. Performance benchmarking of various optimization tools. Time-to-solution for 20 optimization runs is presented local-instance implementations we find greater than two as a function of the optimization complexity, where the lat- orders-of-magnitude performance improvements over an ter is measured by (a) number of control segments in fixed internal na¨ıve optimizer based on NumPy, and 3 5 ∼ − × Hilbert space or (b) Hilbert-space size measured in qubits typical advantage relative to optimization tools in the with a fixed control complexity. Panel (a) treats a four-qubit open-source QuTiP package [99, 100] for the representa- system with three-axis control applied to a single qubit within tive problems treated here. The performance advantages the larger space. Panel (b) considers a Rydberg atom array of the Q-CTRL local instance impementation vary with with two controls of 40 segments each. Cloud-based compu- the details of the selected system, but in all circumstances tation for the Q-CTRL package incurs a fixed overhead of studied are seen to grow with Hilbert-space dimension, approximately three seconds. See App. D for additional de- number of controls, and number of time-segments in a tails. solution. Additional benefits may be gained via implementa- have not performed optimizations using competing pack- tion using customized cloud-compute resources for com- ages with durations beyond one hour. Full details of the plex optimization tasks; support for these resources is a Hamiltonian used in the optimization, software package standard part of the BOULDER OPAL package intro- versions, computational hardware employed, etc. are de- duced in Sec. II. We observe a fixed overhead of approx- scribed in App. D. imately three seconds associated with web-access and data-upload latencies, meaning that the Q-CTRL local instance outperforms cloud-based computations for sim- ple optimization tasks (small Hilbert spaces with low seg- D. Time-domain simulation tools for realistic ment counts). However, for Hilbert-space dimensions as- hardware error processes sociated with problems spanning three to seven qubits, the benefits of the cloud compute engine are manifested A useful approach for analysing the dynamics of an as an approximately 10 reduction in optimization run- algorithm or gate in the presence of noise is via time- time. Beyond seven qubits× (equivalently Hilbert space di- domain simulation. If the noise-free evolution of the sys- mension 128) the cloud-engine automatically routes cal- tem is well-understood, simulation may be used to inves- culations to a GPU, which changes the performance scal- tigate system dynamics in the presence of different noise ing with Hilbert-space dimension. In this regime extrap- sources. olated performance benefits relative to the local instance Simulation packages based on Schr¨odinger integra- implementation approach two orders of magnitude; we tion and matrix multiplication are a common feature of 17 many existing software packages, including various open- Calculation of ensemble-averaged density matrices source platforms. QuTiP [99, 100] supports numerical • over independent but statistically identical noise re- simulations of a wide variety of time-dependent open alizations. and closed quantum systems, enabling noise modelling through its qutip..noise module. Krotov [101] im- In the remainder of this subsection we describe technical plements gradient-based optimization algorithms based details of each of these functions. on Krotov’s method, useful for exploring the limits of controllability in a quantum system. ProjectQ [17–20] provides a quantum computer simulator with emulation 1. Technical details of simulation functionality capabilities, equipped with various compiler plug-ins. pyGSTi [102] offers noise-modelling and characterization A key function of the simulation package is to gen- of single- or multi-qubit systems, with a noise model in- erate time-domain signals consistent with realistic noise cluding stochastic gate errors and SPAM errors. The processes observed in physical hardware, e.g. oscillator Ignes module within IBM’s Python package Qiskit [2, 21] phase noise or magnetic field noise, typically character- includes tools to simulate gate and small-circuit perfor- ized by a measurable noise PSD. Let the underlying noise mance, as well as measure certain noise parameters. Sim- spectral density of interest be denoted S(1)(ω), defined ilalry, pyQuil [4, 24, 25] is a Python library for executing as a one-sided PSD (ω 0), e.g. consistent with stan- and simulating programs via Quil [24], the compiler lan- dard measurements from≥ a spectrum analyzer. A physi- guage developed by the Rigetti Computing. cal measurement of this PSD takes the form of a discrete For the most part, however, available simulation tools (1) (1) (1) data series Sk of N samples, where Sk S (k∆ω) incorporate noise dynamics via quasi-static offsets, or for k 0, ...,{ N } 1 , and ∆ω defines the frequency≈ res- fully stochastic depolarizing models. With the objective olution∈ { of the measurement.− } Samples from the corre- of supplementing existing numerical simulation packages, sponding two-sided spectrum are defined by symmetriz- Q-CTRL provides efficient tools for simulating the dy- ing and rescaling the one-sided spectrum as namic evolution of arbitrary quantum systems subject to a broad class of noise processes. This includes common channels typically encountered in realistic laboratory en- (1) S0 for k = 0 vironments such as correlated and colored semi-classical (2) S 1 S(1) for k = [1,...,N 1] (36) noise processes. User-defined noise PSDs may be used k  2 k ≡ (1) − to characterize arbitrary noise generators in the Hamil-  1 S for k = [N,..., 2N 2] 2 2N 1 k − tonian, enabling the user to simulate the impact on algo- − −  (2) rithmic performance. such that S = 2N 1. The corresponding discrete |{ k }| − The core Q-CTRL simulation module accepts a control amplitude spectral densities, Xk , are defined such that Hamiltonian (expressed as drives, shifts and drifts, as de- (2) 2 { } S = Xk , permitting arbitrary choice of the complex scribed in App. B), together with any number of arbitrary k | | phase of each Xk. Consequently, piecewise-constant time-domain noise processes. These noise processes can multiplicatively perturb the moduli iφk (2) Xk e S , (37) of the drive or shift controls, or contribute additively to ≡ k the system Hamiltonian. From this information, the sim- q ulation module produces an overall piecewise-constant where system Hamiltonian, and solves the Schr¨odingerequa- tion via matrix exponentials to compute the unitary time 0 for k = 0 φk = unif( π, π) for k = [1,...,N 1] (38) evolution operator for the system at arbitrary times. ∼ − − This package provides several key functions that enable  φ2N 1 k for k = [N,..., 2N 2] efficient and useful simulation in noisy environments: − − − − and the constraints imposed by the first and last cases Creation of a time-domain noise process from an • ensure that Xk has Hermitian symmetry, and thus cor- input user-defined noise power spectral density. responds to{ the} spectrum of a real time domain process. The time series, xj , generated by a given realization of Incorporation of a user-defined time-series into a { } • simulation, including data-series interpolation. Xk is then obtained via a suitably-normalized inverse discrete{ } Fourier transform, such that Automated homogenization of time-segmentation • of all input and software-defined time series in order 2N 2 − 2πi jk to permit Schr¨odingerintegration from data sets xj = √∆ω Xke 2N−1 . (39) k expressing different temporal discretization. X=0 Forward propagation of an initial input state sub- This yields a single random realization of a real-valued • ject to calculated time-evolution operators includ- time-domain signal with a power spectrum matching the ing noise. input spectrum S(2)(ω). 18

Algorithm 3 Simulator package enables this upsampling via Whittaker-Shannon {t} ← times at which to simulate dynamics . Arbitrary interpolation. This produces a continuous-time function procedure ControlNoise . Table IV that interpolates the discrete time series, with a ban- drives ← {(γj (t),Cj ) | for j ∈ {1, ...d}} dlimit set by the Nyquist frequency of the discrete data. shifts ← {(αl(t),Al) | for l ∈ {1, ...s}} This takes the functional form drift ← D for (q(t),Q) ∈ drives, shifts do ∞ t k∆t x(t) = xksinc − , (40) {qs, τs} ← distinct segments for q(t) ∆t k=   if Noise = True then X−∞ {S(1,q)}, ∆ω(q) ← sampled PSD for q(t) noise (1,q) (q) where ∆t is the time step between discrete samples in {δqt} ← NoiseSignal({S }, ∆ω , {t}) xk . To approximate the infinite sum, the simulation {qt}, {δqt} ← JointSegments({qs}, {δqt}) { } 0 package automatically performs periodic extension of the {qt} ← {qt} + {δqt} end if input series and truncation of the sum to accuracy within end for the domain of the original time series. Using Eq. 40, the drives0 ← {{γ0 },C  | for j ∈ {1, ...d}} discrete time series xk may then be resampled at ar- j,t j { } 0 0  bitrary times t , yielding the upsampled (or otherwise) shifts ← { {αl,t},Al | for l ∈ {1, ...s}} 0 { } drift ← drift time-series xt . noisy-ctrl 0 0 0 { } {Ht } ← Hamiltonian(drives , shifts , drift ) With discretized time-series data in hand it becomes end procedure possible to simulate the time evolution of a system via in- procedure AdditiveNoise tegration of the Schr¨odingerequation. However, in many for k ∈ {1, . . . , p} do cases the natural temporal discretizations will vary be- Nk ∈ Nadditive . Algo. 1 tween different fields within the system. For example, {S(1,k)}, ∆ω(k) ← sampled PSD for additive noise (1,k) (k) rapidly-fluctuating noise sources may be defined on sig- {βk,t} ← NoiseSignal({S }, ∆ω , {t}) nificantly shorter time scales than control fields, while end for add-noise Pp quasi-static noise processes could be defined on longer {Ht } ← k=1{βk,tNk} . Eq. 20 end procedure time scales. procedure Simulate To enable simulation in such cases, all discretizations tot noisy-ctrl add-noise are automatically resampled on a shared grid prior to in- {Ht } ← {Ht } + {Ht } tot {Ut} ← UnitaryEvolution({Ht }, {t}) tegration. This enables a user to simply input data series {|ψti} ← {Ut |ψ0i} . Eq. 46 as-is and the package will handle all homogenization is- end procedure sues. For example, if a drive control pulse Ω(t) is defined ...... on two segments of duration τ/2 by [Ω , Ω ], but a noise (1) 1 2 function NoiseSignal( {S }, ∆ω, {t}) process β(t) is defined on three segments of duration τ/3 Returns {xt} . Eq. 40 by [β , β , β ], the joint discretization has six segments end function 1 2 3 of duration τ/6 defined by

Na Nb function JointSegments( {Aa, τa}a=1, {Bb, τb}b=1,... ) Ω(t) β(t) series: {Aa} and {Bb} τ/6 Ω1 β1 segment durations: {τa} and {τb}. β(t) Ω(t) τ/6 Ω1 β1 joint segmentation: {Aj ,Bj , τj } . Eq. 41 τ/3 β1 Nj Nj τ/2 Ω1 τ/6  Ω1 β2  Returns {Aj , τj }j=1, {Bj , τj }j=1,... + τ/3 β2 . (41) end function τ/2 Ω2   → τ/6  Ω2 β2    τ/3 β3   τ/6  Ω2 β3    τ/6  Ω β  function Hamiltonian(drives, shifts, drift)  2 3  Returns Hctrl(t) . Eq. B1   end function Assuming the time-domain is jointly partitioned in this way, with respect to the various time-series of inter-

function UnitaryEvolution( {Hj , τj }, {t}) est, the total Hamiltonian may be perfectly expressed {Hj , τj } : segmented Hamiltonian in terms of N piecewise-constant segments on the re- jth segment: τj = tj − tj−1 . Eq. 42 sampled time-domain, taking the form {t}: arbitrary times to U(t). Returns {Ut} . Eq. 43 H1 for t [t0, t1] end function . ∈  .  H(t) = Hk for t [tk 1, tk] (42)  ∈ − Given this form of a discrete, real, time series gen-  . erated from a noise power spectral density (created as  . above or provided directly by the user), it may be desir- HN for t [tN 1, tN ] able to perform simulation using a higher sampling rate  ∈ −  than that native to the data (for example if only low- where t [tk 1, tk] defines start and end times of the frequency noise is specified). The Q-CTRL simulation kth segment,∈ − for k 1, ..., N , and where t 0 and ∈ { } 0 ≡ 19 tN τ. Computing the unitary time-evolution operator indicating high fidelity state transfer from 0 1 with ≡ | i → | i U(t, t0) via Schr¨odingerintegration is then equivalent to negligible population of the leakage level 2 . However, evaluating the matrix exponential product in the presence of noise and leakage errors| thei fidelity of state transfer is reduced by approximately three orders U(t, t ) = U(t, tk)Q(tk, t ), for t [tk, tk ] (43) 0 0 ∈ +1 of magnitude.

iHk(t tk) U(t, tk) e− − for k 1, ..., N (44) ≡ ∈ { } k E. Hardware characterization

Q(tk, t0) U(ti, ti 1). (45) ≡ − i=1 Characterizing the noise profile of a quantum device Y is useful to identify opportunities for improving hard- From Eq. 43 the unitary time-evolution operator may ware, or implementing robust controls targeted at spe- then be computed for arbitrary sample times yielding cific error sources. This includes Hamiltonian parame- the time series U , where U U(t, t ). Using this t t 0 ter estimation [104, 105](e.g. determining phase offsets functionality the{ Q-CTRL} simulation≡ package provides a on control operations due to hardware imperfections), as function to propagate an given initial state ψ and eval- 0 well moving beyond generic averaged-error characteriza- uate the evolved state at arbitrary sample| timesi within tion routines [106] toward detailed microscopic charac- the desired evolution period, computed as terization of time-dependent noise processes. In the fil-

ψt = Ut ψ0 . (46) ter function framework the latter properties are captured | i | i through the noise power spectral density (PSD) for var- In general, however, calculating a single instance of the ious error channels in the system Hamiltonian. This in- temporal evolution of the state is insufficient to under- formation is also useful to evaluate control performance stand the target dynamics, and an ensemble average over and pursue targeted pulse optimizations (both descried different noise realizations is required. The Q-CTRL sim- above). ulation package provides a function to compute the mean In general detailed microscopic information about density matrix associated with an ensemble of propa- hardware noise processes and imperfections is not easily m gated state vectors. Given a set of state vectors ψ determined through conventional hardware calibration {| i} (for 1 m M) produced from an ensemble of simu- protocols. This limit may be overcome using a qubit as a ≤ ≤ lations corresponding to different noise realizations, the measurement device to directly probe local dynamics or mean density matrix ρ is given by in-situ sources of signal distortion impacting system per- M formance. In this subsection we describe software tools 1 ρ = ψm ψm . (47) and techniques designed to employ the qubit as a trans- M | ih | m=1 ducer towards these tasks, covering both non-parametric X noise spectral reconstruction and Hamiltonian parameter estimation. 2. Simulation example

These capabilities are demonstrated in Fig. 5. We 1. Noise spectral estimation model a superconducting qubit as an anharmonic three- level system incorporating leakage, and simulate the Consider a noise Hamiltonian Hnoise(t) as in Eq. 20, time-evolution under a control pulse implementing a comprised of multiple independent noise sources, each NOT gate via Gaussian Half-DRAG (derivative removal described by a corresponding PSD. Appropriately mod- by adiabatic gate) [103]. The simulation also incorpo- ulating qubit controls in the time domain can focus the rates multiple time-dependent noise processes each de- measurement sensitivity to noise in a target spectral scribed by a distinct PSD. For ease of interpretation, in band, as well as selectively enhance sensitivity to a target this example we implement a single quantum logic oper- noise operator. These objectives map to tuning a set of ation subject to high-frequency noise; however with this filter functions corresponding to the particular control- package it is easy to extend this simulation to complex modulation scheme. The problem treated here is how multi-operation circuits experiencing noise on a variety to reconstruct these PSDs from the measurement record of timescales. resulting from a given control-modulation scheme. We This simulation includes time-varying phase noise on have developed spectral reconstruction packages allow- a microwave drive, a time-varying microwave detuning ing users to employ well conditioned control sequences. and an additive ambient dephasing field applied to the These are more flexible than existing spectrum recon- qubit. In each case an input power spectral density (left struction approaches [107] while in tests demonstrating column) is converted to a time-series and combined with superior reconstruction accuracy. Any relevant set of the relevant control channel (middle column), resulting in measurements may be employed to characterize a target a noisy system representation (right column). The sim- noise channel, to produce an overall frequency-dependent ulated performance in the ideal case is shown in Fig. 5d, sensitivity function employed in the reconstruction. The 20

FIG. 5. Simulated time-evolution of a driven subject to leakage and various noise channels. Control comprises an off-resonant qubit drive γ(t) = Ω(t)eiφ(t) with detuning ∆(t), implementing a Gaussian DRAG pulse [103] with I(t),Q(t) and ∆(t) channels (Eq. B17) proportional to a Gaussian envelope, its time derivative, and a Gaussian-square respectively. (a-c) Left column: noise PSDs associated to each noise channel input into the simulation tool. Middle column: time-domain waveforms for ideal controls (upper) and single-instance noise signals (lower). The latter include discrete samples (markers) from applying Eq. 39 to the corresponding PSDs, and continuous-time interpolation (solid lines) using Eq. 40 for high-precision simulation results. Right column: noisy waveforms summing ideal-control and noise contributions. Three different noise processes are treated: (a) phase noise φ(t) → φ(t) + βφ(t); (b) detuning noise ∆(t) → ∆(t) + β∆(t); (c) ambient dephasing βz(t)σz. (d) Evolution of state populations simulated during pulse application, including leakage and noise (Algo. 3). The DRAG pulse is designed to implement a Xπ gate, with ideal population transfer [ P0,P1,P2 ]:[ 1, 0, 0 ] → [ 0, 1, 0 ] Left: ideal DRAG pulse; Right: comparison of ideal (dashed) and noisy (solid) population evolution, plotted on log scale to resolve errors arising from the noise dynamics. process of noise characterization follows a simple work- 2. Implement controls on hardware device and obtain flow, highlighted schematically in Fig. 6: corresponding measurement data.

1. Design control pulses with enhanced measurement 3. Perform data fusion on measurement results to re- sensitivity for probing the target noise process. construct the underlying noise power spectrum. 21

on so-called Slepian waveforms [108, 109] are highly ef- fective for the characterization of both control noise and dephasing [110]. These controls are provably optimal in terms of spectral concentration, i.e. how much spectral weight resides within a target band. Accordingly they mitigate issues of spectral leakage which cause unwanted out-of-band signals to contribute to the measurement as a form of interference. They can be thought of as math- ematically optimal window functions applied directly to the qubit itself, restricting the qubit’s sensitivity to noise. In step (3), data fusion refers to algorithmic post- processing on sensing data [111, 112]. For our purposes, the sensors correspond to different con- trols/measurements used to infer the PSD. Choosing the data-fusion algorithm that produces the best inference on a given data set, however, can depend on a number of factors. For example, the type of noise being charac- terized, the available controls, or the quality of the mea- surement data. Depending on the required resolution, a trade-off exists in which the size of measurement data (and hence experimental complexity) may be reduced, at the cost increased numerical uncertainties under the data-fusion routine of choice. The noise reconstruction package supports two different inference methods: (i) a FIG. 6. Overview of the noise characterization process using method based on singular-value decomposition Eq. 65, multi-dimensional filter functions and SVD spectral inversion and (ii) a method based on convex optimization Eq. 66. technique. Upper: A noise source is probed by a sequence Both support re-configurable fitting criteria for recon- of control solutions each providing sensitivity to a different structing PSDs from a given measurement record. spectral range, as determined by the multi-dimensional filter We now turn to a formal treatment linking the PSD to function. Measurement results are then used to produce a re- the actions of applied controls on the underlying quan- construction of the actual spectrum experienced by the qubit, tum system, and the associated measurement outcomes. with degradation in fidelity determined by the available con- Consider a quantum system consisting of p independent trols and numeric routine. Lower: Concept demonstrating noise sources how an appropriately constructed filter function can serve as a narrowband probe of underlying noise processes, giving ac- p cess to different technical components of the noise spectrum. Hnoise(t) = βk(t)Nk(t) (48) Selecting an alternate control can shift the peak in the filter k=1 function in order to allow broadband sampling of the noise X spectrum. where the βk(t) are stochastic scalar-valued noise fields with corresponding PSDs, Sk(ω). The structure of Hnoise(t) may be probed by defining a set of c distinct In step (1), the design of appropriate control pulses de- control protocols pends on the type of noise being probed (described by the H ,j(t) , j 1, ..., c (49) noise operator), the availability of controls supported by { ctrl } ∈ { } the device (described by the control operators), as well as any physical limitations set by the classical control hard- and measuring the corresponding infidelities. ware itself. A range of controls is available for character- From Sec. III B, and assuming the noise is suffi- izing familiar processes such as control-amplitude noise ciently weak, the infidelities may be approximated or ambient dephasing respectively. However the package as supports generalizations to higher-order noise processes, p ∞ dω j (j) e.g. Fig. 12 shows reconstruction results in a multi-qubit F (ω)Sk(ω) , j 1, ..., c (50) 2π k ≈ I ∈ { } setting using a novel two-qubit control protocol. In cases k=1 Z−∞ where experimental simplicity is prioritized, dephasing- X j noise information can be obtained using timed sequences where Fk (ω) is the leading-order filter function associ- of simple driven rotations, often referred to as pulsed dy- ated with the jth control protocol and kth noise source. namical decoupling sequences [107]. Here quantum bit The filter functions may be computed using Eq. 33 given flips are sequenced in order to produce a filter function knowledge of the control Hamiltonians and dynamical with a dominant peak at the frequency defined by the in- noise generators, while the infidelities may be obtained verse interpulse delay. In contrast, shaped controls based from experiment. 22

Let [ωmin,k, ωmax,k] denote the frequency domain and the estimated infidelities are arranged as spanned by the low- and high-frequency cutoffs, assum- ing they exist, for each PSDs in Eq. 50. We may then Iˆ1 define the sample frequencies Iˆ2 Iˆ =  .  . (60) . ωk,` = ωmin,k + (` 1)∆ωk, (51)   −  ˆc   I  for samples ` 1, ..., s(k) , incremented by frequency   steps ∈ { } The matrix dimensions therefore satisfy ˆ ωmax,k ωmin,k dim F = c n (61) ∆ωk = − (52) × s(k) 1 dim Sˆ = n 1 (62) −  × on each domain k 1, ..., p . Assuming sufficiently large dim Iˆ = c 1 (63)  × sample numbers, s∈(k {), Eq. 50} may be recast as a discrete p  sum, with the integrals approximated using the trape- where n = k=1 s(k). From Eq. 57, performing noise zoidal rule. Specifically reconstruction thus reduces to solving the matrix inverse P 1 problem Sˆ = Fˆ− Iˆ. Depending on the particular set of ∆ω δ δ`,s k Iˆj = k Fˆj Sˆk,` 1 `,1 1 ( ) (53) controls and noise sources, and on the dimensions c, p, 2π k,` − 2 − 2 ˆ 1     and n, the exact matrix inverse F − may not exist. Gen- erally, the system may be underdetermined or overde- where δ is the Kronecker delta[113], and the sum runs ij termined, and the matrix Fˆ may be singular. Finding implicitly over repeated tensor indices. Here we have solutions to this form of problem is discussed next. introduced the following tensor notation for the various We have developed two distinct machine-learning tech- sampled quantities niques used to solve this inversion problem which trade j j j accuracy in the presence of complex noise spectra for F (ωk,`) Fˆ ∆Fˆ (54) k ≈ k,` ± k,` computational efficiency. Importantly, both approaches k,` k,` Sk(ωk,`) Sˆ ∆Sˆ (55) go beyond published techniques by accepting arbitrary ≈ ± measurement records and accounting for the full form (j) Iˆj ∆Iˆj (56) I ≈ ± of the filter function (including harmonics and hardware- induced imperfections), rather than using simplifying ap- where Qˆ denotes the estimated value for the quantity Q, ˆ proximations. The first method is based on an efficient and ∆Q denotes its uncertainty [114]. implementation of pseudo-inverse by singular value de- The challenge, then, is to obtain estimates, Sˆk,` ∆Sˆk,` ± composition (SVD). The second, based on convex op- for the power spectral densities by inverting the relation- timiztion (CO), addresses numerical instabilities of the ship defined by Eq. 53, given knowledge of the measured SVD method when noise spectra exhibit narrowly defined quantites Iˆj ∆Iˆj and computed values F j ∆F j . ± k,` ± k,` features or“spurs”. Both techniques enable parameter- As a first step we move to a discretized matrix repre- free estimation needed to perform reconstructions with- sentation. Namely, out a priori knowledge of the underlying structure of ˆ ˆ ˆ the noise, and are easily generalized beyond single qubits F S = I, (57) based on the multi-dimensional filter-function formal- ˆ ˆ ˆ ˆ ism Sec. III B. An experimental demonstration for inter- where F = F 1 F 2 F p is a horizontal concate- acting superconducting qubits is presented in Sec. IV D. nation of matrices of the··· form   To facilitate efficient numerical solutions to the spec- 1 ˆ1 ˆ1 ˆ1 1 ˆ1 tral estimation problem we provide a pseudoinverse tech- 2 Fk,1 Fk,2 ... Fk,s(k) 1 2 Fk,s(k) − nique based on a singular-value decomposition (SVD) 1 Fˆ2 Fˆ2 ... Fˆ2 1 Fˆ2 ∆ωk  2 k,1 k,2 k,s(k) 1 2 k,s(k) method. This approach is numerically efficient and works Fˆk = − , 2π ...... well in circumstances where noise spectra are expected  . . . . .   1 ˆc ˆc ˆc 1 ˆc  to vary smoothly as a function of frequency. The general  2 Fk,1 Fk,2 ... Fk,s(k) 1 2 Fk,s(k)  −  approach may be used to obtain a pseudo-inverse if the  (58) problem is undetermined, to perform regression if it is over-determined, or to calculate the exact inverse if it is the estimated PSDs are concatenated vertically as in fact determined. Usefully, in all cases, the singular value decomposition of Fˆ takes the same general form: ˆ k,1 S1 Sˆ Sˆ Sˆk,2 Fˆ UDV ˆ 2 ˆ = †, (64) S =  .  , Sk =  .  , (59) . .     Here, U is a (c c) unitary matrix, V † is a (n n)  Sˆ   ˆk,s(k)  × ×  p   S  unitary matrix, and D is a (c n) rectangular diagonal     × RevTex page dimensions Full page (21.59 cm x 27.94 cm) = (612 pt x 792 pt) Double-column text (17.98 cm x 23.59 cm) = (510 pt x 669 pt) Single-column text (8.65 cm x 23.59 cm) = (245 pt x 669 pt)

DOUBLE COLUMN WIDTH: 510 pt = 17.98 cm SINGLE COLUMN WIDTH: 245 pt = 8.65 cm

10 0 10 Main body: Latex 10 ⌦(!)⇤()()⌅(⇠)⇧(⇡)() A(a)B(b)F (f)N(n)R(r)S(s)T (t) 10 , 10 , 10 | | |

23

10-9 + ) where D is a diagonal matrix with entries 1/si for all

−1 a CPMG filter functions non-zero singular values, and zero otherwise.

F (W As mentioned above this technique functions well for -8 10 smoothly varying noise spectra, but can suffer from in- stabilities especially in circumstances where the noise ex- Fixed domain Domain splicing hibits “spurs” that are spectrally narrow relative to the probe filter function. In this case, the lack of a strict b c positivity criterion for the pseudoinverse can cause oscil-

) lations in the reconstruction which result in unphysical −1 True PSD Hz estimates of the spectrum (Fig. 7b,c). In order to ac- ! Reconstruction commodate these more complex cases we next introduce a second method for spectral estimation which ensures SVD reconstruction SVD positivity of all estimates at the expense of increased computational complexity. d e A convex-optimization technique enables better esti- mates of a noise power spectrum in the presence of com- plex spectral characteristics. Returning to the discretized True PSD

Noise spectral density (W Reconstruction form of Eq. 57, we see that in general there are in fact reconstruction infinitely many solutions to this equation. The key task

CO CO is then to find a set of solutions that will be considered reasonable based on some prior information about the Frequency (Hz) system; here we add a condition of strict positivity for all inverted representations of Sˆ. FIG. 7. Spectral reconstruction of simulated dephasing noise In our CO implementation, instead of directly finding a using 51 CPMG sequences [115, 116], all with total dura- solution to Eq. 57, we reformulate the problem with the tion 3 µs. (a) Filter functions {Fi} corresponding to CPMG orders i ∈ {0, ..., 50}, plotted in 51 colors interpolated be- prior information as an objective function. By minimiz- ing that objective function, the optimal solution should tween [black, magenta]→ [0, 50]. Filter functions [F0,F50] have spectral peaks centred at [0, 0.5] MHz. Spectral peaks represent our best understanding of the problem. This for intermediate-order filter functions are separated by incre- approach can be formalized as follows: ments of 10 kHz. Sensitivity to dephasing over the frequency 2 P min ˆ( F Sˆ I + λR(Sˆ)) s.t. Sˆ 0 (66) domain is captured by Fi (grey fill). (b,d) Artificially S k − k2 ≥ smooth dephasing PSD (grey) reconstructed using SVD (ma- where denotes the Euclidean norm. genta, top) and CO (violet, bottom). Both reconstructions k · k2 were performed using frequencies uniformly sampled on the The second term in the objective function is known as domain [0, 0.5] MHz. (c,e) Reconstruction of a complex de- the regularization term, and λ > 0 is a hyper-parameter. phasing PSD with 1/f background trend, discrete spurs and In the language of machine learning, a suitable choice finer structure mimicking real hardware noise. Again, the of the hyper-parameter and regularization will prevent true PSD is plotted in grey, overlaid with SVD (magenta, over-fitting. The hyper-parameter λ does not have any top) and CO (violet, bottom) reconstructions. In this case physical meaning, but it can be taken as a weight re- the frequency domain was partitioned into 4 intervals. Recon- flecting how our prior information would impact the so- structed PSDs were spliced together from independent recon- lution. In our algorithmic approach we follow a conven- structions on each sub-domain for improved frequency resolu- tional “L-curve criterion” for finding the optimal hyper- tion. In all cases (b-e), SVD and CO methods provide reason- able quantitative agreement with the data sets. However the parameter λ [117]. Similarly, there are many approaches SVD technique exhibits oscillations due to numerical insta- to choose the regularization term R(Sˆ), and our algorith- bilities that are evident for more compelx spectra (c). These mic implementation supports any user-defined form. We are absent in the CO reconstruction (e). For all these results, elect to incorporate two distinct approaches to regulariza- simulated measurement records were generated numerically tion which may be used in combination to accommodate and reconstructions performed as describe in Algo. 4 allow- the possibility of a smoothly varying Sˆ incorporating a ing performance comparisons focused on the efficacy of the sparse set of discrete features, without violating positiv- underlying linear-algebraic method. ˆ ˆ 2 ity. First, we express R(S) = DS 2 using the so-called Tikhonov matrix D, whose formk dependsk on the prior information [118]. We select a form for D which corre- matrix with non-negative real numbers on the diagonal. sponds to the first-derivative operator The columns of U and V are the left- and right-singular vectors of Fˆ, and the diagonal elements of D, denoted si, are known as the singular values. The final represen- 1 1 − .. tation is then given by D = (67)  ..  ˆ + ˆ 1 1 S = VD U †I, (65)  (n 1) n  −  − × 24

Algorithm 4 Noise reconstruction on a smoothly varying background are accurately recon-

{Nk(t)} ← distinct noise operators, k ∈ {1, ..., p} structed without suffering from numerical instabilities. (m) Both approaches are employed in an experimental set- {Hctrl (t)} ← distinct controls, m ∈ {1, ..., c} procedure Controls/Measurements ting for a multiqubit gate on a cloud quantum computer for m ∈ {1, ..., c} do in Sec. IV D. ˆm (m) I ← avg. infidelity msmst. . Implementing Hctrl for k ∈ {1, ..., p} do (k) 2. Hamiltonian parameter estimation {fν } ← frequency domain, ν ∈ {1, .., s(k)} m (k) (m) {Fk,ν } ← FF({fν }; Hctrl ,Nk) . Algo. 1 end for Hamiltonian parameter estimation is based on an effi- end for cient model-reduction technique, allowing a system with Iˆ ← [Iˆm] . c × 1 matrix complex observables to be represented through a finite ˆ  m  F k ← Fk,ν . c × s(k) matrix set of proxy parameters. In such a circumstance, instead ˆ ˆ ˆ Pp F ← [F 1 ... F p] . c × n matrix, n = k=1 s(k) of performing an effectively unbounded set of character- end procedure ization measurements, we may restrict ourselves to iden- tifying this much smaller set of parameters, at some cost ˆ ˆ function ReconstructSVD(F , I) in the accuracy of the model achieved. The problem of ˆ ˆ ˆ ˆ U, D, V ← SVD(F ) identifying a system by characterizing its dynamics can ˆ Returns S . Eq. 65 be formulated as an optimization problem where we find end function system parameters using a set of measurement results as input points. If we know how these parameters affect the function ReconstructCO(Fˆ, Iˆ) dynamics of the system, we can establish a cost function R ← regularization function, default kDSˆk2 . Eq. 67 2 that represents how unlikely it is that the input points λ ← FindHyperparameter(Fˆ, Iˆ,R) could have been generated by a given choice of system cost(Sˆ) ← kFˆSˆ − Iˆk2 + λR(Sˆ) . Eq. 66 parameters. With such a cost function, the same set of Sˆoptimal ← Optimize(cost(Sˆ)) . Algo. 2 functions that are used to optimize control operations Returns Sˆoptimal end function as in Sec. III C can then be adapted to characterize a system. function Svd(Fˆ) More formally, suppose we want to determine n system Returns Uˆ , Dˆ , Vˆ as SVD of Fˆ . Eq. 64 parameters θ1, θ2,..., θn. To achieve this, we subject end function the system to k experimental setups that are differently affected by the values of these parameters. Such exper- function FindHyperparameter(Fˆ, Iˆ,R) iments could consist of different kinds of pulses applied Returns the hyperparameter λ to the qubits, or different interrogation times, for exam- end function ple. The averaged results for each experiment then form a set of k input points y1, y2,..., yk, each of them with such that minimizing DSˆ 2 minimizes the difference associated standard deviations ∆y1, ∆y2, . . . , ∆yk. This k k2 is the data that will be provided to the optimizer. among the elements of Sˆ, indicating an expectation that To perform the estimation of the parameters of the sys- Sˆ varies smoothly in the parameter space. tem, these inputs will be combined inside the optimizer Alternatively, the regularization term may be chosen with knowledge about the dynamics of the system. The as λ Sˆ 2. The L norm will enforce the sparsity of the 1 1 dynamics will be encapsulated in functions Y (θ), which optimalk k solution. This is a reasonable assumption if we m represent the ideal average value of the mth experiment expect Sˆ to be composed of a few non-zero features across if the system evolved according to a vector of parameters a broad range of frequencies. This particular type of L 1 θ = (θ , θ , . . . , θ ). Assuming independent probability optimization problem is well-known for its application in 1 2 n distributions for each of the averaged measurement re- compressed sensing for sparse signal processing [119]. In sults, the likelihood that a certain choice of values of our protocols we generally combine these two regular- the parameters θ was responsible for the vector of input ization procedures in order to treat a broader range of points y = (y , y , . . . , y ) is given by the product of the conditions for the noise spectrum Sˆ. 1 2 k individual probabilities for each input point, yielding With this formulation, and employing either regular- ization condition both the objective function in Eq. 66 k p(y θ) = p(ym θ). (68) and constraints are convex, enabling efficient numeric | | m=1 convex optimization. In our algorithmic implementation, Y this optimization is handled using the toolkit described Further assuming Gaussian probability distributions for in Sec. III C, as per the pseudocode presented in Algo. 4. the averaged measurement results, we have The advantages of the CO reconstruction are displayed 2 1 [Ym(θ) ym] in Fig. 7d,e. Here, both smoothly varying functions p(ym θ) = exp − . (69) | 2 − 2(∆y )2 and complex mixed spectra exhibiting narrow features 2π(∆ym)  m  p 25

This likelihood can be maximized by minimizing its neg- Algorithm 5 Sample system identification ative logarithm. Removing the constant terms, an ap- k ← number of distinct experiment setups propriate cost function for the optimizer to minimize is {ym} ← distinct input points, m ∈ {1, . . . , k} {∆ym} ← distinct standard deviations, m ∈ {1, . . . , k} k [Y (θ) y ]2 m m y θ procedure SystemIdentification C = − 2 log [p( )] . (70) 2(∆ym) ∝ − | C(θ) ← SampleCostFunction(k, {ym}, {∆ym}) m=1 X θ ← Optimize(C(θ)) . Algo. 2 V ← CovarianceMatrix(C(θ), θ) 2 This choice of cost function also allows us to assess the σ ← diagonal√ elements of V precision of the parameter estimates. As C only differs ∆θ ← 2 σ2 . errors estimated as 2σ from the negative log likelihood by constant terms, its end procedure Hessian (the matrix of second partial derivatives with respect to the parameters θ) can be identified with the function SampleCostFunction(k, {ym}, {∆ym}) Q(θ) ← operator as a function of θ . map to matrix Fisher information matrix , where IFisher for m ∈ {1, . . . , k} do τm ← duration of the mth experiment 2 2 ∂ C ∂ Om ← observable measured in the mth experiment Fisher = log [p(y θ)] . (71) |ψ i ← initial state for the mth experiment I ≡ ∂θi∂θj −∂θi∂θj | m     vm ← pulse segment values for mth experiment αm ← PwcScalar(τm, vm) . Algo. 2 Using the Cram´er–Raobound, the minimum value of the Hm(t, θ) ← PwcOperator(αm(t),Q(θ)) . Algo. 2 covariances of the parameter estimates is limited by the Um(θ) ← Unitary(τm,Hm(t, θ)) † inverse of the Fisher information matrix: Ym(θ) ← hψm| Um(θ)OmUm(θ) |ψmi end for P 2  2 1 C(θ) ← [Ym(θ) − ym] / 2(∆ym) . Eq. 70 cov(θ) − , (72) m ≥ IFisher Returns C(θ) end function where cov(θ) is the covariance matrix for the parameters θ. function CovarianceMatrix(C(θ), θ) The way this optimization procedure can be pro- IFisher ← Hessian of C(θ) with respect to θ . Eq. 71 V = I−1 . inverse of a matrix grammed is shown in Algo. 5. The system dynamics en- Fisher Returns V capsulated in the maps Ym(θ) can be represented using { } end function the same built-in functions from Algo. 2. For example, ...... the same description of a piecewise constant Hamiltonian used there for pulse optimization can be used here to rep- Built-in method for building cost functions: resent the effect of an input PWC pulse in a system whose control Hamiltonian contains parameters θ that we wish function Unitary(τ, H(t)) . solves the Schr¨odingereq. R τ 0 0 to determine. Likewise, by representing the objects that U(τ) ← T exp{−i 0 dt H(t )} are part of the cost function from Eq. 70 in the same Returns U(τ) manner used for pulse optimization, we can re-use the end function same optimization function used in Algo. 2 to estimate system parameters here. These three parameters Ωx,Ωy, and Ωz can be identi- Once we are in possession of the parameter estimates, fied by performing experiments in which we prepare the we can use them together with Eq. 71 to find the lower qubit in three different initial states, and then measure bounds of the elements of the covariance matrix of θ. it after different wait times. The diagonal elements of this matrix represent the vari- If the qubit measurements were performed in the same ances of the estimated variables. Assuming a normal eigenbasis in which the qubit was prepared, information distribution, two times the square root of these variances about the direction in which the qubit is rotating could will estimate the errors of the parameters with 95% con- be lost, as both clockwise and counterclockwise rotations fidence. would decrease the population of the initial state. To A simple example of system identification using this avoid this problem, we prepare the qubit in three initial method consists in characterizing a constant single-qubit states that are eigenstates of σx, σy, and σz, and measure Hamiltonian. Excluding terms proportional to the iden- it in a different eigenbasis (σz, σx, and σy, respectively). tity, which do not affect the state evolution, a constant Whether the measured observable increases or decreases single-qubit Hamiltonian is characterized by three coeffi- after the initial time gives information about the direc- cients that multiply the Pauli matrices: tion of the rotation. To simulate how the Hamiltonian estimation could be 1 performed for a system of this kind, we select a set of H = (Ωxσx + Ωyσy + Ωzσz) . (73) 2 true values for Ωx,Ωy,Ωz, and use them to calculate 26 the expectation values in different experimental setups. are not exhaustive representations of product capability, We generate 20 input points for each of the three initial and that additional demonstrations for e.g. optimizing states. Each of these points will correspond to a differ- parallel Mølmer-Sørensen gate implementation, or char- ent wait time between state preparation and measure- acterizing simultaneous noise processes in qubits will ment. We allow the measured populations to have errors be presented in separate manuscripts. that are distributed according to a normal distribution Trapped-ion quantum computers already exist at with standard deviation 0.01, corresponding to the ∆ym medium scales and provide an ideal platform for studies in Eq. 70. of quantum control efficiency due to long intrinsic life- In this example, we attempted to identify a system times, high-fidelity operations, and access to multiqubit with the following set of parameters: devices. We have used a trapped-ion quantum computer composed of individual 171Yb+ ions in order to explore Ωx = 0.5 2π MHz, (74) · the efficacy of quantum control and quantum control op- Ωy = 1.5 2π MHz, (75) timization in real hardware. · Ωz = 1.8 2π MHz. (76) We begin with demonstrations of error-robustness us- · ing open-loop control solutions available in the OpenCon- We ran 30 optimizations following the procedure de- trols package of driven single-qubit operations. In Fig. 8 scribed in Algo. 5. Each optimization started with differ- we probe the robustness of various composite control op- ent random initial values for the parameters, limited by erations implementing an effective Xπ gate (equivalently the Nyquist frequency set by time step between exper- a π pulse) to quasi-static errors in the pulse amplitude iments. Out of these 30 runs, the one with lowest cost and detuning (Fig. 8b,c). Protocols designed to provide provided the following estimates for the parameters: robustness to the associated error channel reveal little de- viation from the baseline error rate achieved in the center Ωˆ x = (0.494 0.016) 2π MHz, (77) ± · of the graph (zero induced error) while the measured infi- Ωˆ y = (1.499 0.022) 2π MHz, (78) delity ( ) increases rapidly in the presence of systematic ± · errors forI non-robust controls. This difference is a key Ωˆ z = (1.808 0.018) 2π MHz. (79) ± · signature of error-robust control solutions. This simple example highlights how the formulation Similarly, using a so-called ‘system-identification’ tech- in Algo. 5 may be used with high fidelity to efficiently nique to probe control robustness to a time-varying per- perform critical parameter estimation tasks. turbation [58] we demonstrate that appropriately crafted controls suppress noise at frequencies slow compared with the control rate (Fig. 8d,e). Experimental measurements IV. QUANTUM CONTROL CASE STUDIES compare well with calculation of the control filter func- tion (solid lines), which is available through both BLACK A. Open-loop control benefits demonstrated in OPAL and BOULDER OPAL. In particular, these ex- trapped-ion QCs periments demonstrate that it is possible to construct single-qubit logic operations robust to noise in both the In the sections above we described the role of quantum control amplitude and qubit-frequency detuning. control in combating hardware error, and introduced new Moving beyond physical-layer benefits we can also technical capabilities for the characterization and opti- probe the manner in which these control operations in- mization of quantum hardware performance. In this sec- tersect with higher levels of the quantum computing tion we provide case studies to demonstrate the applica- stack. For instance, in Fig. 8f we demonstrate homog- tion of these capabilities in contemporary quantum com- enization of Parallel Randomized Benchmarking (RB) puting hardware. First, we provide experimental demon- error rates across a 10-qubit quantum computer using strations of performance of open-loop control solutions error-suppressing open-loop gate constructions validated in trapped-ion hardware, demonstrating error-robustness in Fig. 8b-e. Here the dominant error source is a spa- as well as error-rate homogenization in space and time. tial gradient in the coupling of the qubit drive field to Second, we apply the numerical optimization package de- the individual ions, due to reflections and interference of scribed in Sec. III C to generate single and multi-qutrit the 12.6 GHz microwaves inside the ion-trap vacuum en- gates optimized for robustness against leakage and de- closure. We therefore select an control-noise suppressing phasing errors in a coupled-transmon system. Third, solution and replace all gates in the randomized bench- we apply the SVD and CO spectral reconstruction tech- marking procedure with their logically equivalent error- niques outlined in Sec. III E to the IBM Q cloud-based robust constructions [123]. quantum processor to characterize noise affecting two- In this experiment the best-performing qubit does not qubit cross-resonance gates. Finally, we present an ex- exhibit a net improvement in the measured RB error rate, ample of optimizing the structure of a , pRB—a proxy measure for gate error—beyond measure- producing a logically-equivalent compiled circuit exhibit- ment uncertainty due to other limiting error sources such ing suppression of cross-talk errors arising from a con- as laser-light leakage. However, all other qubits exhibit stant ZZ interaction. We emphasize that these examples RB error rates that now approximately match the best 27

FIG. 8. Experimental validation of dynamic error suppression techniques. (a) Schematic of experimental setup (details in App. E). Qubits defined by Zeeman-split hyperfine ground states of trapped 171Yb+ ions in a linear Paul trap; qubits resonantly driven by a 12.64 GHz microwave pulses; state detection via 369 nm fluorescence. (b) Four Xπ-pulse constructions to be tested, with varying error-robustness properties. Primitive (red, no robustness); BB1 [120] (purple, amplitude robustness); CORPSE [121] (cyan, detuning robustness); CinBB [122] (blue, amplitude + detuning robustness). (c,d) Experimental demon- stration of robustness to quasi-static errors. BB1 is most robust to pulse amplitude errors, as indicated by a low measured infidelity as a function of applied over-rotation error. CORPSE shows similar performance in the presence of detuning errors. CinBB shows comparable performance in the presence of both forms of error. The primitive implementation is susceptible to both types of error. (e,f) Demonstration of robustness to time-varying noise. Error-suppressing gates show robustness at low noise frequencies (left of the graph), resulting in lower measured infidelities (markers). Measurements agree with filter function predictions (solid lines). All gates show an onset of error susceptibility at high frequencies near the inverse gate time. (g) Error homogenization across spatially-distributed qubits measured by randomized benchmarking. A global microwave drive simultaneously implements a Xπ-pulse on 10 qubits spatially distributed in an ion chain. Different qubits experience different effective Rabi rates due to the imperfect spatial profile of the microwave amplitude. Under the primitive implementation (red) qubits manifest divergent error rates; the BB1 implementation (purple) is robust to these amplitude-errors, and therefore sup- presses and homogenizes them. Shading indicates the range of experimental outcomes while the mean error across the device is indicated by lines. Using the error-suppressing pulse, the mean error is reduced ∼ 5× while the range (measured either by the standard deviation or the difference between minimum and maximum values) is reduced ∼ 10×. (h-j) Enhanced stability of 2- qubit Mølmer-Sørensen gates over time, comparing primitive and robust controls. The ideal outcome for both gates is described by P0 = P2 = 0.5 and P1 = 0, where Pn is the probability of finding n−of−2 ions in the |1i state. Gates are repeated over 3.5 hours and final populations logged. Populations P0 (black), P1 (blue), and P2 (red) are estimated via a maximum-likelihood procedure [73]. Panel (H) shows the outcome for the primitive gate with no robustness (1st-order sensitivity to errors). Panel (i) shows the outcome for a phase-optimized gate robust to detuning errors (2nd-order sensitivity to errors). For comparison, panel (j) shows the ideal gate populations assuming no errors. Colored shading represents the range of the associated data set over the measurement window. The range of measurements is dramatically narrower for the robust gate and closer to the ideal case. reported values, with the standard deviation of RB error We compare two different gate constructions, one be- rates across the 10-qubit array reduced 10.2 using the ing relatively susceptible to drifts and the other designed appropriate open-loop control solution. × to reduce sensitivity via a modulation protocol available Moving beyond the application of control solutions for in BOULDER OPAL, experimentally demonstrated first single-qubit gates, we examine the stability of two-qubit in [72, 73], and discussed in detail in [74]. Repeatedly gates realized via the Mølmer-Sørensen interaction on a performing the same gate shows variations in the mea- pair of trapped ions as the system experiences drifts in sured ion-state populations, corresponding to reductions time. In this experiment we are targeting the creation of in gate fidelity. However, by using the error-suppressing a ( 00 i 11 ) /√2; ideally in this experiment gate construction we observe a 3 4 reduced suscep- ∼ − × there is an equal| i − probability| i of measuring two ions in tibility to system drifts, indicated by arrows in Fig. 8h, 0 or 1 , and one should never observe any experiments showing the reduced range of outcomes. with| i one| i ion each in these two states. Therefore our Finally, we demonstrate the efficacy of numerically op- key proxy measure for gate performance is the measured timized single-qubit gates against various noise processes population of zero, one, and two ions in state 1 . The in trapped-ion qubits in Fig. 9. Specifically, we have fo- expected performance of these metrics is shown in| iFig. 8i. cused on the use of the optimization toolkit described EXPORT: NO LINE

28

robustness to error in the presence of up to 10% miscali- a 6 brations in qubit frequency and Rabi rate, similar to the (kHz) results of Fig. 8b,c. Further details on the execution of 0 these experiments is included in App. E. ⇡ Similar results have been obtained using superconduct-

Primitive ing circuits on IBM Q, and full code for generating opti- 0 (rad) 0 mized controls and experimentally demonstrating them ⇡ on hardware is available via Ref. [124]. The particular so- 0 85 lution employed for the superconducting circuit was im- Time (μs) plemented using IBM’s OpenPulse format [21] through b 6 Qiskit, and was filtered in order to comply with band- limits in transmission lines (such constraints are gener- (kHz) ally not germane in trapped-ion systems due to the rel- 0 atively long pulse durations and use of microwave an- ⇡ tennae rather than transmission lines). We have also

Optimized 0 identified that pulses smoothed with a sinc filter and dis- (rad) 0 cretized in time using the flexible optimization engine de- ⇡ scribed in Sec. III C generally perform better than slew- 0 425 Time (μs) rate-limited pulses on IBM Q hardware, as the latter can occasionally include spectral components matched to hardware resonances (e.g. two-level systems). Over- c d Optimized all these results demonstrate that the flexibility of the Primitive control-optimization approach described here allows for high-fidelity error-robust gates to be implemented on di- verse hardware systems. Robustness

B. Simultaneous leakage and noise-robust controls −0.1 −0.1 for superconducting circuits

FIG. 9. Experimental demonstration of optimized controls in a trapped-ion quantum computer. (a, c) Bloch-sphere For superconducting qubits, a two-level system is typ- representation of primitive and Q-CTRL optimized robust ically singled out from the many levels of an anharmonic controls, respectively. Both nominally implement a Xπ oscillator. When driven by naive single-qubit controls, gate. (b,d) Corresponding waveforms plotted in Polar co- the system is subject to off-resonant coupling to leakage ordinates. The Q-CTRL waveform was optimized to pro- levels outside the qubit manifold, resulting in substantial vide dual suppression of both detuning and amplitude errors, leakage errors. In addition, these qubits face the com- and constrained to ensure a fixed pulse amplitude (phase- mon challenges of decoherence from ambient dephasing, modulation only). (e,d) Experimental demonstration of ro- control-phase and control-amplitude noise. bustness against quasi-static control amplitude and detuning Suppression of leakage errors has been the focus of errors for each pulse. Gates were implemented on an ion-trap considerable research in the superconducting community experiment (Fig. 8a). Infidelities were measured while scan- ning over engineered amplitude and detuning offsets. These and has been demonstrated to improve gate performance. are plotted on the x-axis in fractional units relative to the The standard approach at present employs an analytic Rabi rate or qubit frequency respectively. Shading represents optimal control technique to implement target quantum the net improvement in error robustness afforded by the op- operations via so-called DRAG pulses [103], or variants timized solution. Further details of the experimental imple- thereof. For example, Half-DRAG is designed to suppress mentation are provided in App. E. leakage out of the qubit subspace via dual-quadrature control, typically involving a Gaussian pulse on σx, and its time derivative simultaneously applied on σy. in Sec. III C to produce gates that are simultaneously Unfortunately this technique does not combine suc- robust against control noise and dephasing. Typically cessfully with other open-loop error-suppression strate- this requires a concatenated analytic construction which gies needed to combat decoherence from additional noise dramatically extends the control duration by up to 24 channels, e.g. NMR-inspired composite pulses [125]. × relative to the primitive gate. For an Xπ gate the opti- For example, concatenation of pulse segments defined mizer returns solutions showing simultaneous robustness by DRAG into an overall CORPSE structure, known to to error with a gate duration reduced 5 relative to suppress detuning noise (see Sec. IV A), fails as the dual- this analytic approach. In the presence∼ of× quasi-static axis DRAG control breaks the geometric construction re- errors the numerically optimized solutions provide show quired to provide noise robustness. 29

Advancing on previous work, we present optimal and gates [92, 93]. This overcomes the scaling penalty im- robust controls that simultaneously reduce sensitivity to posed by frequency crowding in conventionally coupled both leakage and dephasing errors by orders of magni- [126], though it suffers from decoherence chan- tude, using the optimization tools described in Sec. III C. nels arising from control noise in the parametric drive. Our starting point is the Hamiltonian for an anharmonic We perform first-principles analyses of dominant error three-level qutrit subject to dephasing noise and leakage channels and introduce novel gate structures incorporat- to the lowest-lying excited state in the system (Fig. 10a): ing numeric optimization via tools described in Sec. III C in order to suppress the influence of these control-induced η 2 2 errors. H(t) = γ(t)a + H.C. + (a†) (a ) + βz(t)σz (80) 2 Two-qubit parametrically-driven gates may be imple- mented between one fixed- and one tunable-frequency √  where a = 0 1 + 2 1 2 . We encode this anharmonic transmon. A control flux drive Φ(t), with frequency ω oscillator using| ih | a drift| ihcontrol| with operator η (a )2a2; p 2 † and phase offset θ , is applied to the tunable-frequency a microwave drive control with operator a and complex p iφ(t) transmon resulting in a modulated transition frequency pulse envelope γ(t) = Ω(t)e− ; and an additive noise of the form operator with Pauli operator σz (see App. B for further details on this representation). ωT (t) =ω ¯T +ω ˜T cos (2ωpt + 2θp) (81) We perform two robust-control optimizations subject to different constraints (Table II). First, we implement whereω ¯T is the average shift in qubit frequency andω ˜T is a concurrent optimization allowing dual-quadrature con- the amplitude of the modulation caused by the applied trols similar in required controls to Half-DRAG (e.g. IQ flux drive. The Hamiltonian for the system under this modulation). Next we perform a fixed-waveform opti- modulation, transforming to an interaction picture, takes mization that holds the amplitude of the control pulse the form associated with the microwave drive fixed while allowing ∞ ω˜T +i(2ωpt+2θp)n its phase to vary, as in phase-modulation. The resulting Hint(t) = g(t) Jn e 2ωp waveforms are displayed in Fig. 10. n=   X−∞ We compare performance in three distinct ways which it∆ illustrate the simultaneous robustness to both leakage e− 10 01 × | ih | (82) and dephasing errors in a pulse whose duration is the n i(∆+ ηF )t + √2e− | | 20 11 same as the Half-DRAG solution. First, we represent | ih | i(∆ ηT )t the dephasing-noise operator associated filter function. + √2e− −| | 11 02 | ih | We see that the filter functions for the two optimized i(∆+ ηF ηT )t + 2e− | |−| | 21 12 + H.C. . controls show a low-frequency-noise suppressing charac- | ih | ter similar to that illustrated in Fig. 3, while all other o controls indicate broadband noise admittance. Next, we Here g(t) describes the capacitive coupling between the use the numerical simulation tools described in Sec. III D transmon qubits; ηT (ηF ) are the positively-defined an- to determine control robustness to quasi-static dephas- harmonicities for the tunable-frequency (fixed-frequency) transmons; ∆ =ω ¯T ωF is the detuning between the av- ing errors. In this circumstance the two optimized so- − lutions demonstrate a broad plateau of fixed detunings erage transition frequency of the tunable-frequency qubit over which the infidelity remains low, again following the and the fixed transition frequency of the fixed-frequency experimental results of Fig. 8b,c. Finally, we simulate qubit; and Jn(x) is the nth-order Bessel function of the the full evolution of the three states of the qutrit un- first kind. A detailed description of the underlying phys- ical system and the derivation of the associated Hamil- der application of the net Xπ rotation and applied noise. Here we see that despite the complex dynamics at times tonians can be found in [91–93, 127]. less than the gate time, at the conclusion of the gate Target entangling gates are activated by matching the the optimized solutions show the appropriate net state modulation frequency ωp to the detuning between rele- transfer. Other optimization approaches such as RC- vant energy levels of the capacitively-coupled transmons. filtered and slew-rate-bounded controls have been used For typical experimental parameters, the time-dependent to demonstrate similar performance. Overall these so- phase factors on the Hamiltonian operators above lead lutions represent new controls that – for the first time to rapidly-oscillating terms in the system evolution that – allow simultaneous leakage-error and dephasing-noise effectively suppress the coupling rate to the associated suppression in a single optimized construction. transitions. Activation of a target transition is achieved by resonantly tuning the drive frequency to cancel the associated phase factor. In particular: C. Robust control for parametrically-driven iSWAP: 10 01 2nωp = ∆ (83) superconducting entangling gates | i ↔ | i CZ : 11 20 2nωp = ∆ + ηF (84) 20 | i ↔ | i Parametric activation of entangling gates presents CZ : 11 02 2nωp = ∆ ηT (85) 02 | i ↔ | i − a paradigm enabling tunable, high-fidelity two-qubit 30

a Transmon qubit b Q-CTRL optimization costs

Control solution

Primitive 2.2 10−1 2.6 10−2 2.2 10−1

Half DRAG 9.1 10−3 4.1 10−2 1.1 10−2

Q-CTRL: AM + M 9.1 10−9 1.6 10−8 2.5 10−7

Q-CTRL: Fixed amplitude 2.7 10−9 4.9 10−9 2.6 10−7

c Primitive d Half DRAG e Q-CTRL: AM + M f QCTRL: Fixed amp. 60 60 60 60

(MHz) 0 0 0 0 ⇡ ⇡ ⇡ ⇡ 0 0 0 0 (rad) ⇡ ⇡ ⇡ ⇡

Primitive Half DRAG AM + M Fixed amp. Primitive Half DRAG AM + M Fixed amp. g h ) −1 ) Hz −1 ! W ( (W

−1.0 Frequency (Hz) Relative detuning error

FIG. 10. Q-CTRL pulses optimized to suppress leakage and dephasing in a transmon qubit. (a) Energy level diagram and schematic of transmon qubit, modelled as a 3-level system with anharmonicity η. Dephasing is modelled as a time-varying shift iφ(t) βz(t) in the qubit energy splitting, resulting in an effective detuning of the drive Ω(t)e form resonance. (b) Performance metrics for control solutions presented in (c-f). Cost functions Coptimal and Crobust are defined in Table I. The total infidelity is computed as Itot = Ioptimal + Irobust with Irobust given by the integral in Eq. 31, evaluated using the PSD plotted on the right axis in panel (g). (c-f) primitive and Half-DRAG compared to optimized Q-CTRL pulses. Optimization constraints (Table II): (green) none (purple) fixed drive amplitude. All pulses are designed to implement a Xπ gate, with ideal population transfer [ P0,P1,P2 ]:[ 1, 0, 0 ] → [ 0, 1, 0 ]. In each panel: (top) state evolution visulized on the Bloch sphere (App. F); (middle) waveforms plotted in polar coordinates (Eq. B17); (bottom) evolution of state populations simulated during pulse application, including leakage and dephasing (Algo. 3). Q-CTRL solutions suppress errors in final populations P0 and P2 (leakage channel) by orders of magnitude compared to both primitive and Half-DRAG in the presence of noise. (g) Robustness in the frequency domain: (left axis) dephasing filter functions computed for all pulses (Algo. 1); (right axis) PSD for dephasing field βz(t). Filter functions for Q-CTRL pulses are small at low frequencies, indicating superior dephasing suppression. (h) Robustness to quasi-static detuning errors for each pulse. Gate infidelities are computed while scanning over a constant value of βz. Flatter response of Q-CTRL pulses indicates superior robustness. 31

The use of a parametric drive with a user-defined am- the full control Hamiltonian is then written plitude, phase, and frequency introduces a new control- induced channel for errors in the gate. To account for Hctrl(t) = HiSWAP(t) + Hqubit-F(t). (94) these control errors we assume the flux drive, and conse- This Hamiltonian is then parameterized according to the quently the parametric drive in Eq. 81, experience three prescription in App. B, Hctrl(t) = γ(t)C + H.C. in terms distinct error processes of the drive pulses and operators

modulation offset error:ω ¯T ω¯T + ¯T (86) +iξ(t) +iφ(t) → γ(t) = Λ(t)e , Ω(t)e , modulation amplitude error:ω ˜T ω˜T + ˜T (87) →   modulation frequency error: ωp ωp + p (88) → 1 10 01 C = 2 | ih | . 1 0 1 I where the  are assumed to be small errors. These gen-  2 | ih | ⊗  erate additional Hamiltonian terms which, performing a We introduce three novel solutions providing robust- Taylor expansion in the small offset parameters and mov- ness against control errors in the parametrically activated ing to the interaction picture, result in the noise Hamilto- gate. All combine an iSWAP coupling drive Λ(t) with nian Hnoise(t) = β(t)N, where β(t) captures the effective single-qubit rotations which yields full control over the noise strength. We introduce a noise-operator of the form relevant subspace. This may be examined by observing that sandwiching an iSWAP operation between a pair N = IF (Π1 + 2Π2) . (89) ⊗ of single-qubit Xπ gates permits the realization of the Here Πi = i i defines the projection operator onto the (Hermitian) operator | ih | ith eigenstate of the tunable-frequency transmon, and IF is the identity on the fixed-frequency transmon. 0 0 0 1 The iSWAP interaction is activated by resonantly driv- 0 0 0 0 ing the 10 01 term, for example by setting the 1st-order Aeff , (95) | ih | ∝ 0 0 0 0 (n = 1) resonance condition ωp = ∆/2. Assuming this 1 0 0 0 configuration we may therefore restrict attention to the   relevant (4 4) iSWAP subspace, spanned by the eigen- similar in structure to a general NOT gate. Solutions states × need not employ this particular gate, but leverage the full controllability afforded by the combination of single- 00 , 10 , 01 , 11 . (90) | i | i | i | i qubit and iSWAP control modulation. With this formulation of the control problem we are In this case the remaining rapidly-oscillating terms may able to directly deploy numeric optimization in order to be ignored, and Eq. 82 reduces to find control solutions combing modulation of the para-

1 +iξ(t) metric drive and single-qubit control. In Fig. 11c,d we Hi (t) Λ(t)e 10 01 + H.C. (91) SWAP ≈ 2 | ih | present two representative numerically optimized solu- tions subject to constraints outlined in Table II. First, ω¯T we produce a fixed-amplitude solution which combines where the parametric coupling rate Λ = 2g(t)J1 2ω p a phase-modulated coupling drive with an interleaved and the parametric drive phase ξ = 2θp.   On the iSWAP subspace the noise operator defined single-qubit control, compatible with situations in which in Eq. 89 reduces to both controls cannot be applied simultaneously. The single-qubit operations are enacted with fixed amplitude, 1 0 0 0 but variable durations (hence variable rotation angles) 1 1 −0 1 0 0 and variable phase. Similarly we present a band-limited, N = IF σz = (92) 2 ⊗ 2  0 0 1 0 concurrent solution incorporating these two drives. Here − we have enforced, as an example, an RC-filter on the con-  0 0 0 1   trols (see TableII) to match potential band limits as may resembling dephasing on the subspace of the tunable- be experienced in a system with finite transmission-line frequency qubit. This new analysis thus shows that the bandwidth. In these cases we observe enhanced robust- three different channels for the introduction of noise via ness to quasi-static errors, validated by time-domain sim- the parametric drive are manifested at the Hamiltonian ulation, as well as time-varying noise captured through level as an effective dephasing process. filter functions (Fig. 11e,f). Our objective is now to craft control solutions which We can compare these solutions to an approach de- are able to suppress this effective dephasing channel us- fined analytically (Fig. 11b), recognizing that dephasing ing the control available to us. Incorporating the fixed- noise can be mitigated by the action of the spin echo frequency transmon term and Walsh-modulation on a driven operation. We com- bine single-qubit Xπ operations with an iSWAP control 1 +iφ(t) Hqubit-F(t) = Ω(t)e 0 1 + H.C. IT (93) envelope defined using a superposition of Walsh func- 2 | ih | ⊗   tions. This approach has previously been used to craft 32 dephasing-robust single-qubit driven operations [34, 58] plying a sequence of 3 quantum gates defined by and provide a simple means to realize error robustness. This solution provides similar overall performance, but UE = XbCNOTabHa, (97) requires 18.5% more time to execute than gate result- ing from∼ a fixed-amplitude constrained optimization. where CNOTab is the controlled-not gate on control qubit Overall these examples demonstrate how high- a and target qubit b, Ha is the Hadamard operator on performance solutions may be achieved under a wide qubit a and Xb is a NOT gate on qubit b. Then i iden- range of constraints for entangling gates in superconduct- tity gates are applied to both qubits followed by a swap ing circuits. We have achieved similar results for the CZ operation defined as gate and non-parametric cross-resonance gates. SW = CNOTabHabCNOTabHabCNOTab, (98)

where Hab = Ha Hb. A second SW operation is applied D. Experimental noise characterization of after an additional⊗ j identity gates. Then M 16 i j = multiqubit circuits on an IBM cloud QC 50 i j identity gates are employed before reverting− − − the − − quantum state via the UE† operation. The schematic of Microscopic noise characterization is widely employed the probing sequence is shown in Fig. 12b. This probing in the development of optimized control solutions for a sequence effectively implements a series of π pulses in the range of devices including superconducting qubits [128]. two-qubit system, analogous to implementing a CPMG However, existing protocols have focused on the char- (Carr-Purcell-Meiboom-Gill) sequence [115, 116] used in acterization of global fields measured at the single- single-qubit dynamic decoupling, or measuring spin re- qubit level [107, 110, 129]. The combination of multi- laxation in NMR. dimensional filter functions (Sec. III B) and flexible noise A set of generalized filter functions and the compos- reconstruction algorithms (Sec. III E) permit new in- ite spectral sensitivity function for the set of control se- sights to be gleaned from real experimental quantum quences can be constructed for each sequence as i, j vary computing hardware. (Fig. 12d). Subsequently, when the two-qubit system is We have focused on the characterization of previously subject to noise, a corresponding set of infidelity mea- unidentified microscopic noise sources present in entan- surements can be obtained and used to infer the noise gling gates executed on cloud-based superconducting power spectral density via the SVD noise reconstruction quantum computers [23]. At present access to such sys- method described in Sec. III E. The hardware constraints tems is highly restricted, making the arbitrary applica- we face on implementation - result in a somewhat inef- tion of complex modulated controls on subspaces within ficiently conditioned set of measurements, each probing the machines impossible. Accordingly, we have developed overlapping spectral regions. This makes standard ma- and deployed a simplified probe protocol consisting of se- trix inversion approaches to spectrum reconstruction im- quences of entangling gates for two-qubit noise character- possible and helps demonstrate the value of flexible spec- ization. This probing sequence is readily implementable tral estimation techniques. on the current IBM quantum computing platform, with We implement the new probing sequence on the IBM Q filter functions for the individual sequences calculable us- 5 Tenerife (ibmqx4) quantum computer [130]. Fig. 12a ing the software functionality introduced in Sec. III E. depicts the device chip layout and qubit couplings; here, Our probing sequence is designed to characterize two- we choose the qubit pair Q0 and Q2 for the experimental qubit dephasing noise defined by the noise operator results displayed, but all pairs have been characterized in detail yielding qualitatively similar results. For this 1 device, CNOT20 can be natively implemented between N = (Za Zb) (96) 2 − these two qubits. The values of i and j for the probing sequences are where Za and Zb are the Pauli Z operator on qubits a and varied to construct a set of filter functions with high sen- b, respectively. This probing sequence consists of a fixed sitivity for a broad range of frequencies of interest, up number M of single-qubit and two-qubit quantum gates, to 250 kHz. For each chosen values of i, j, the corre- in which each quantum gate has a fixed gate duration sponding quantum circuit was executed over 8192 shots, of Tg. Fixing M - and in particular the number of two- yielding the average infidelity depicted in Fig. 12c as a qubit gates used - ensures that signatures arising from colorscale heatmap. For a fixed i, as j increases until the imperfect execution of the entangling gates do not vary second SW operation is placed roughly half-way between between sequences and swamp the noise signals to be the first SW and the UE† operations, the average infidelity measured. In general, M can be chosen suitably based becomes small, resembling an echo-effect similar to that on the hardware specification and Tg; here, we choose of CPMG sequences. However there is additional struc- M = 66 to ensure the total duration of the experiment is ture present which breaks the symmetry of these graphs, within the coherence time of the IBM NISQ computers indicating other noise contributions at higher frequencies. and Tg = 110 ns. Utilizing both the SVD and CO methods (Sec. III E), a We first prepare the Bell state ( 01 + 10 )/√2 by ap- reconstructed noise power spectral density based on these | i | i 33

a Parametrically driven gates b Q-CTRL optimization costs

Control solution

Primitive 0.0 1.73 2.6 10−4

Q-CTRL Analytic design 0.0 0.0 1.5 10−6

Q-CTRL: Fixed amplitude 1.6 10−8 2.0 10−12 2.0 10−6

Q-CTRL: Bandlimited 2.0 10−9 7.3 10−9 4.9 10−6

c Primitive e Q-CTRL: Fixed amp. f Q-CTRL: Bandlimited 1 1 1 0

(MHz) 0 (MHz) 0 (MHz) −1 ⇡ 1 00 0 (rad)

⇡ (MHz) d Q-CTRL: Analytic design −1 1 10 10 0 (MHz) (MHz) 0 0 (MHz) −10 10 ⇡ 10 00 0 (rad) (MHz) ⇡ (MHz) 0 −10

Primitive Analytic Fixed amp. Bandlimited Primitive Analytic Fixed amp. Bandlimited g h ) ) −1 −1 Hz W ! ( (W

−0.1 Frequency (Hz) Relative detuning error

FIG. 11. Q-CTRL pulses optimized to suppress control errors for parametrically driven two-qubit entangling gates in super- conducting circuits. (a) Schematic of capacitively-coupled transmon qubits with fixed frequency (F ) and tunable frequency (T ). Single-qubit interactions are driven on F by the pulse Ω(t)eiφ(t), while parametric modulation of the flux Φ(t) generates effective iSWAP interactions described by the pulse Λ(t)eiξ(t). Noise enters the system via hardware errors on the flux modulation. (b) Performance metrics for control solutions presented in (c-f). Cost functions Coptimal and Crobust are defined in Table I. The total infidelity is computed as Itot = Ioptimal + Irobust with Irobust given by the integral in Eq. 31, evaluated using the PSD plotted on the right axis in panel (g). (c) Primitive coupling gate. (d) Analytically designed Walsh-modulated gate. (e) Q- CTRL optimized gate: interleaved single- and two-qubit controls with fixed-amplitude constraint (phase modulation only). (f) Q-CTRL optimized gate: simultaneous single- and two-qubit controls with band-limited 5 MHz RC filter constraint (Table II). (g) Robustness in the frequency domain: (left axis) filter functions computed for all pulses (Algo. 1); (right axis) PSD for noise field β(t) associated effective detuning errors generated by the noise operator N (Eq. 92). Filter functions for Q-CTRL pulses are small at low frequencies, indicating superior dephasing suppression. (h) Robustness to quasi-static detuning errors for each pulse. Gate infidelities are computed while scanning over the relative error defined by β/Λmax, where β scales the magnitude of the noise Hamiltonian as Hnoise = βN, and Λmax denotes the maximum permissible value for the parametric drive amplitude Λ(t) (2π × 1 MHz for these simulations). Flatter response of Q-CTRL pulses indicates superior robustness. results is shown in Fig. 12e. These result shows that with The breadth of spectral features observed is due to the high confidence, the two-qubit dephasing noise exhibits a Fourier limits of the individual measurements employed low-frequency noise component and a repeatable higher- in the reconstruction routine, as confirmed by numerical frequency noise contribution in the range 150 200 kHz. simulations. − RevTex page dimensions Full page (21.59 cm x 27.94 cm) = (612 pt x 792 pt) Double-column text (17.98 cm x 23.59 cm) = (510 pt x 669 pt) Single-column text (8.65 cm x 23.59 cm) = (245 pt x 669 pt)

DOUBLE COLUMN WIDTH: 510 pt = 17.98 cm SINGLE COLUMN WIDTH: 245 pt = 8.65 cm

FINAL ARRANGEMENT: GUIDING LINES

34

a Cross-resonance gates b Control sequence probing noise c Measurement record

Time infidelity

3 3 3 3 66 gate spaces , position of 1st SW gate

, position of 2nd SW gate ) 1

– d e ) 1 W – W )

11 SVD reconstruction −1 – 11 Hz – CO reconstruction " W 5 10 ( Noise spectral density Sensitivity (10 Sensitivity Filter functions (10

Frequency (104 Hz) Frequency (104 Hz)

FIG. 12. Noise characterization in the IBM Q 5 Tenerife (ibmqx4) device. (a) Chip layout is shown identifying the two qubits for which data are presented. (b) Schematic of measurement procedure: (top) time-varying two-qubit dephasing noise associated with the noise operator in Eq. 96; the control sequence probing the noise, parameterized by the timing positions (i, j) of the two SW gates. (c) Measured infidelity from all probe sequences (i, j). (d) Multi-dimensional filter functions {Fi,j } computed as in Algo. 1 for the noise channel in Eq. 96, for all probe sequences (i, j). Sensitivity to the target noise process P over the frequency domain [0, 350] kHz is captured by Fi (grey fill). (e) Reconstructed two-qubit dephasing PSD using SVD (magenta) and CO (violet) methods described in Algo. 4.

We have observed similar performance across multiple pilation”. We consider a complex circuit composed of qubit pairs, with variations in the strength of the quasi- multiple interacting transmons and subject to unwanted static component. Numerical simulations have been used cross-coupling. We use numerical optimization in order to demonstrate that similar results to those shown in to implement a target circuit, subject to constraints on Fig. 12e arise for a simple spectrum composed of a quasi- available controls and circuit duration, and optimized to static noise component and a single fixed-frequency spur combat always-on cross-talk errors through the structure at higher frequencies. Similarly we have confirmed by of the circuit itself (no gate-level optimization). Our ob- engineering numerically synthesized data used in the re- jective is to demonstrate the utility of the optimization construction that the presence of the feature in the range software tools introduced in Sec. III C for a new class of 150 200 kHz does not appear to be an artefact of either problem in a high-dimensional Hilbert space. − the measurement routine or the reconstruction method. Due to the low anharmonicity of transmons, quantum These experimental results represent an early demon- computations can be designed to exploit the three lowest- stration of microscopic noise characterization within two- energy levels. The relative detunings between the various qubit gates using a new software toolkit permitting energy levels in an ensemble of transmons gives rise to an greater flexibility in control-based quantum noise spec- always-on effective ZZ-type coupling Hamiltonian that troscopy. The identification of a high-frequency spectral can be exploited for generating entangling operations. component in a range commonly associated with elec- However, this coupling also leads to residual cross-talk tronic noise provides guidance on system improvement errors that degrade algorithmic performance. Below we and noise suppression strategies for these machines. describe an example physical system and create an opti- mized circuit construction which suppresses these resid- ual couplings. In spirit, this approach is similar to the E. Crosstalk-resistant circuit compilation low-level compilation of collections of logical subcircuits using analog control waveforms - rather than a universal In this subsection we demonstrate the use of optimal gate set - as relayed in [131]. control for algorithmic design and “hardware-aware com- We consider a linear arrangement of 5 , labelled 35 q 1, ...5 . For a given qutrit pair p = (q, q + 1), char- and ω e2πi/3. acteristic∈ { detunings} between respective energy levels gen- Assuming≡ excitations between qutrit states 0 2 erate relative phases on states 11 , 12 , 21 , and 22 . cannot be controlled, we consider a restricted control| i ↔ ba- | i In this case the total coupling Hamiltonian| i | i | isi written| i sis spanning only single-qutrit operations coupling states 0 1 and 1 2 . We further assume these may (1,2) | i ↔ | i | i ↔ | i Hzz = Hzz I I I be implemented instantaneously and in parallel across all ⊗ ⊗ ⊗ (2,3) qutrits within the circuit. + I Hzz I I ⊗ ⊗ ⊗ (99) The total control Hamiltonian may be written (3,4) + I I Hzz I ⊗ ⊗ ⊗ 5 (4,5) + I I I Hzz q q q ⊗ ⊗ ⊗ Hctrl(Ω, φ) = Hν (Ων , φν ) (102) q=1 ν 01,12 where nearest-neighbour interactions between pair p are X ∈{X } described by where p p p Hzz = α11 11 11 + α12 12 12 Ω = Ω1 ,... Ω5 , Ω1 ,... Ω5 , (103) p | ih | p | ih | (100) 01 01 12 12 + α21 21 21 + α22 22 22 1 5 1 5 | ih | | ih | φ = φ01, . . . φ01, φ12, . . . φ12 . (104) p and the αij are effective coupling strengths, tabulated The assumption of instantaneous single-qutrit operations in Table III for all pairs. Here I is the identity on a p allows us to absorb the duration ∆t over which the cor- 3-dimensional single-qutrit Hilbert space, Hzz operates responding unitary is implemented, yielding a total evo- on a 32-dimensional Hilbert space associated with the 5 lution operator pth qutrit pair, and Hzz operates on the 3 -dimensional

Hilbert space associated total 5-qutrit system. Uctrl(θ, φ) = exp [ iL(θ, φ)] , θ = ∆tΩ (105) As an example algorithm, we consider a circuit on this − 5-qutrit system which seeks to simultaneously execute where controlled-sum (CSUM) gates on qutrit pairs (1, 2) and 5 (3, 4), while leaving the 5th qutrit unaffected. This may L(θ, φ) = θq exp [+iφq ] Cq + H.C. (106) be expressed formally as ν ν ν q=1 ν 01,12 X ∈{X } Utarget = UCφ UCφ I (101) ⊗ ⊗ Here we refer to driven operations on the qth qutrit and νth transition, with Rabi rate Ωq and phase φq . where UCφ is a 2-qutrit phase gate, locally equivalent to ν ν a CSUM, defined as Within this formulation we have defined single-qutrit drive operators

|00i| 01i| 02i| 10i| 11i| 12i| 20i| 21i| 22i 0 0 0   1 1 |00i 1 C10 = 1 0 = 1 0 0 (107)   2 | ih | 2   |01i  1  0 0 0     |02i  1      0 0 0   1 1 |10i  1  C = 2 1 = 0 0 0 (108)   21   2 | ih | 2   UCφ = |11i  ω∗  0 1 0       |12i  ω    which are generalized for the qth qutrit within the multi-   |20i  1    qutrit system   |21i  ω    q (q 1) (n q 1) Cν = I⊗ − Cν I⊗ − − , ν 01, 12 . (109) |22i ω∗ ⊗ ⊗ ∈ { } Our approach to circuit-level optimization for residual- cross-talk suppression is through the integration of de- qutrit pairs αp αp αp αp 11 12 21 22 terministic dynamic decoupling. We partition the circuit p = (q, q + 1) (2π MHz) (2π MHz) (2π MHz) (2π MHz) · · · · implementing Eq. 101 into m periods of free evolution (1, 2) −0.27935 0.1599 −0.52793 −0.74297 under the always-on coupling Hamiltonian Eq. 99, inter- (2, 3) −0.1382 0.15827 −0.33507 −0.3418 leaved with m + 1 gates of the form (3, 4) −0.276 −0.6313 0.24327 −0.74777 k Pj = U (θj,`, φ ), j 0, ...m (110) (4, 5) −0.26175 −0.49503 0.14497 −0.70843 ctrl j,` ∈ { } ` Y=1 TABLE III. Example ZZ-type coupling strengths between each composed as products of k distinct control unitaries nearest-neighbor qutrit pairs within a circuit. of the form Eq. 105. In this expression the jth period, of 36

a b Optimized inter-pulse durations ✓01

01 k Q = exp i ✓kei⌫ Ck + H.C. Durations k ⌫ ⌫ ✓12 " k=01,12 ✓01 # 01 12 P k ik k Qk = exp i (μ✓s)e ⌫ C +0.07 H.C. 0.12 0.20 0.33 0.37 0.18 ⌫ ⌫ ✓12 " k=01,12 # 12 P 5.31 2.88 2.24 0.51 4.52 0.79 2.37 6.26 3.63 5.26 3.59 5.61 4.36 6.11 5.06 1.25 0.54 5.69 3.92 5.36 5.51 2.01 0.0 6.2 1.03 -0.49 -1.89 -1.49 -0.46 -1.73 -0.17 1.16 -1.85 c -1.78Optimized pulse sequence-1.150001-1.150001 for-2.25 multi-2.3 -1.23-qutrit2.89 1.29circuit -1.9 -2.69 -0.08 0.56 1.11 1.64 0.0 2.66 -1.96 Q5 2.11 2.65 0.0 5.75 3.82 1.45 0.71 2.08 1.26 2.24 0.54 3.44 1.07 1.37 4.6 2.53 3.86 3.47 5.48 5.43 3.31 4.7 1.77 0.0 2.54 -1.32 1.04 0.0 1.12 1.34 -2.88 0.98 0.35 5.31 0.782.88 2.24 0.51 4.52 0.79 2.37-1.746.261.24 1.61 0.01 0.183.63 3.11 2.0 5.26 3.59 5.61 4.362.646.11 -1.75.06 2.621.25 -0.81 -2.37 2.3 -3.050.54 0.05.69 -0.613.92 5.36 5.51 2.01 0.0 6.2 1.03 -0.49 -1.89 -1.49 -0.46 -1.73 -0.17 1.16 -1.85 -1.78 -1.05 -1.05 -2.25 -2.3 -1.23 2.89 1.29 -1.9 -2.69 -0.08 0.56 1.11 1.64 0.0 2.66 -1.96 Q5 2.11 2.65 0.0 5.75 3.82 1.45 0.71 2.08 1.26 2.24 0.54 3.44 1.07 1.37 4.6 2.53 3.86 3.47 5.48 5.43 3.31 4.7 1.77 0.0 2.54 -1.32 1.04 0.0 1.12 1.34 -2.88 0.98 0.35 0.78 -1.74 1.24 1.61 0.01 0.18 3.11 2.0 2.64 -1.7 2.62 -0.81 -2.37 2.3 -3.05 0.0 -0.61

0.0 0.0 0.75 0.56 3.69 3.94 2.06 4.53 0.0 1.36 2.13 3.53 0.0 3.52 5.51 0.88 6.25 5.69 0.0 0.59 4.69 1.5 1.39 2.94 4.57 0.0 0.0 -0.32 1.47 -1.19 0.55 -0.39 0.35 0.0 -1.34 0.79 1.79 0.0 -0.43 -1.01 0.73 3.11 0.49 0.0 0.26 2.67 -1.33 2.77 -1.34 1.83 Q4 0.0 3.14 5.79 5.41 1.38 3.86 3.48 2.03 0.0 3.140.0 0.75 0.56 3.69 3.94 2.066.234.534.81 5.6 5.08 4.810.0 5.51 0.26 1.36 2.13 3.53 0.0 1.613.52 2.055.51 0.880.0 3.01 2.38 2.22 3.426.255.495.69 6.030.0 0.59 4.69 1.5 1.39 2.94 4.57 0.0 2.14 -1.36 -2.1 -2.24 -2.84 -3.02 -0.29 0.0 -2.30.0 -0.32 1.47 -1.19 0.55 -0.390.140.35-0.71 1.61 2.75 2.710.0 2.71 -2.64 -1.34 0.79 1.79 0.0-0.34-0.43 2.3-1.01 0.730.0 -0.58 -0.18 -2.19 0.683.111.630.49 -1.820.0 0.26 2.67 -1.33 2.77 -1.34 1.83 Q4 0.0 3.14 5.79 5.41 1.38 3.86 3.48 2.03 3.14 6.23 4.81 5.6 5.08 4.81 5.51 0.26 1.61 2.05 0.0 3.01 2.38 2.22 3.42 5.49 6.03 0.0 2.14 -1.36 -2.1 -2.24 -2.84 -3.02 -0.29 -2.3 0.14 -0.71 1.61 2.75 2.71 2.71 -2.64 -0.34 2.3 0.0 -0.58 -0.18 -2.19 0.68 1.63 -1.82

0.0 3.72 2.35 3.87 4.55 3.21 4.4 6.12 4.19 1.83 1.59 4.95 5.66 4.19 4.08 5.14 2.58 1.66 0.57 3.89 2.54 5.5 0.24 2.25 0.5 0.0 3.11 -1.78 2.26 -0.55 -2.39 1.9 -0.07 -2.8 2.6 -0.86 1.03 -0.18 -0.89 1.87 -1.91 3.01 -0.33 0.29 -0.93 -0.26 2.08 0.39 1.5 3.07 Q3 0.0 3.72 2.35 3.87 4.55 3.21 4.4 6.12 4.19 1.83 1.59 4.95 5.66 4.19 4.08 5.14 2.58 1.66 0.57 3.89 2.54 5.5 0.24 2.25 0.5 0.0 5.09 6.28 3.68 0.43 0.47 1.28 2.29 0.0 4.683.11 -1.78 2.26 -0.55 -2.39 1.90.17-0.075.86 4.32 0.0 4.1-2.8 0.0 1.59 2.6 -0.86 1.03 -0.182.3-0.89 0.01.87 4.11-1.91 6.05 4.7 3.68 4.193.012.06-0.33 4.510.29 -0.93 -0.26 2.08 0.39 1.5 3.07 0.0 0.33 2.45 2.06 3.02 -0.71 -1.6 -3.11 Q3 2.45 -1.27 -1.12 -2.81 0.0 2.08 0.0 2.58 1.59 0.0 -1.18 -0.81 2.48 0.43 1.62 -2.16 2.91 0.0 5.09 6.28 3.68 0.43 0.47 1.28 2.29 4.68 0.17 5.86 4.32 0.0 4.1 0.0 1.59 2.3 0.0 4.11 6.05 4.7 3.68 4.19 2.06 4.51 0.0 0.33 2.45 2.06 3.02 -0.71 -1.6 -3.11 2.45 -1.27 -1.12 -2.81 0.0 2.08 0.0 2.58 1.59 0.0 -1.18 -0.81 2.48 0.43 1.62 -2.16 2.91

3.13 4.44 5.2 1.63 4.2 1.41 0.0 5.06 6.28 4.48 2.81 5.84 0.91 1.09 6.23 3.17 3.83 1.63 4.33 5.99 2.75 3.79 0.0 0.56 0.0 2.58 2.59 1.78 -0.92 1.77 1.37 0.0 2.45 3.13 0.444.44 5.2 1.63 4.2 1.41 0.02.345.06-0.02 -2.23 -2.78 -3.136.28 2.67 1.22 4.48 2.81 5.84 0.911.741.09 1.016.23 2.393.17 1.28 1.75 1.52 0.03.832.971.63 0.04.33 5.99 2.75 3.79 0.0 0.56 0.0 Q2 2.58 2.59 1.78 -0.92 1.77 1.37 0.0 2.45 0.44 2.34 -0.02 -2.23 -2.78 -3.13 2.67 1.22 1.74 1.01 2.39 1.28 1.75 1.52 0.0 2.97 0.0 0.0 4.46 2.83 1.99 2.31 1.96 1.24 1.02 Q2 0.0 1.86 5.91 4.16 2.43 2.31 4.45 3.3 1.3 2.81 0.0 6.25 0.24 0.31 4.81 4.52 1.64 0.0 4.46 2.83 1.99 2.31 1.96 1.24 1.02 0.0 1.86 5.91 4.16 2.43 2.31 4.45 3.3 1.3 2.81 0.0 6.25 0.24 0.31 4.81 4.52 1.64 0.0 1.77 -3.06 -1.28 0.91 -2.03 -0.58 -2.1 0.0 0.01.77 -3.06 -1.28 0.91 -2.03 -0.582.54-2.1 1.85 -0.77 -1.27 0.810.0 -0.75 2.17 2.54 1.85 -0.77 -1.27-2.350.81-1.35-0.75 2.170.0 0.01 -0.62 -0.56 -0.0-2.35-1.64-1.35 2.970.0 0.01 -0.62 -0.56 -0.0 -1.64 2.97

1.51 2.65 4.41 2.41 0.22 1.09 3.5 0.87 1.51 5.592.65 4.41 2.41 0.22 1.09 3.50.920.875.34 1.09 0.7 2.855.59 5.63 5.62 0.92 5.34 1.09 0.7 1.742.85 2.095.63 5.365.62 1.72 3.37 3.22 6.221.744.132.09 1.035.36 1.72 3.37 3.22 6.22 4.13 1.03 -0.68 -0.8 -0.09 -0.57 2.96 0.76 -2.4 1.27 -0.68-3.03-0.8 -0.09 -0.57 2.96 0.76 -2.4-0.71.27-0.59 1.29 -1.32 0.41-3.031.17 0.45 -0.7 -0.59 1.29 -1.32-1.290.41-1.721.17 1.970.45 -1.03 -2.18 -2.54 -0.29-1.29-1.68-1.72 0.11.97 -1.03 -2.18 -2.54 -0.29 -1.68 0.1 Q1 Q1 2.27 2.63 3.58 1.17 0.46 1.11 5.6 1.31 2.84 0.85 0.0 2.61 1.36 1.07 4.22 2.13 5.98 5.83 3.17 6.08 3.74 1.38 4.26 1.24 0.67 2.27 2.63 3.58 1.17 0.46 1.11 5.6 1.31 1.5 2.841.82 1.14 2.05 2.33 -1.01 0.690.85-1.51 0.0 2.61 1.36 1.07-2.154.22 2.13 0.92 0.0 1.74 -2.335.98-1.325.831.71 3.172.71 6.08 3.74 1.38 4.261.981.24-1.98 0.671.42 3.0 1.7 -1.65 -2.68 1.0 0.33 1.5 1.82 1.14 2.05 2.33 -1.01 0.69 -1.51 -2.15 0.92 0.0 1.74 -2.33 -1.32 1.71 2.71 1.98 -1.98 1.42 3.0 1.7 -1.65 -2.68 1.0 0.33

⌧1 ⌧2 ⌧3 ⌧4 ⌧5 ⌧6 ⌧1 ⌧2 ⌧3 ⌧4 ⌧5 ⌧6 P0 P1 P2 P3 P4 P5 P6 P0 P1 P2 P3 P4 P5 P6

FIG. 13. Optimized 5-qutrit circuit. Each qutrit is controlled via 0 1 and 1 2 transitions. Control on each transition is iφ | i ↔ | i | i ↔ | i captured via the phasor γν = θν e ν , comprising rotation, θν , and phase angles, φν , where ν 01, 12. As shown in the inset, each ∈ single-qutrit operation is indicated via the block of angles [θ01, φ01 θ12, φ12], with corresponding colours. Consecutive sequences of block | arrays indicate product operations of the form Pj defined in Eq. 110. Blocks of unitary operations are separated by durations τj . All selected phasor components on the control operations and values of τj are returned via the circuit optimization procedure. The optimal −3 cost for this circuit compilation is optimal = 5.7 10 . I ×

duration τj, starts and ends with instantaneous unitaries in Eq. 35 as Pj 1 and Pj respectively. This structure corresponds to a − C(v) = (v) + C (τ ) (111) generalized dynamic decoupling sequence and augments Ioptimal duration the controllability of the 5-qutrit system due to the non- where optimal(v) is defined in Sec. III A and Cduration(τ ) commuting terms in the operator products. imposesI a penalty for exceeding the upper limit chosen This generalized dynamic decoupling sequence struc- for the circuit duration. We set a threshold of 1.5 µs, ∼ ture must now be numerically optimized in order to re- chosen assuming a qutrit coherence time of 20 µs. turn the target circuit functionality expressed in Eq. 101, ∼ which necessarily entails cancellation of the ZZ cross- P0 P1 P2 P3 Pm−1 Pm coupling. Optimization of the control structure is per- formed on the search space spanned by the timing vari- // t ables τ = (τ1, ..., τm), rotation variables θ`,j, and phase t0 0 t1 t2 t3 tm−1 tm τ variables φ for ` 1, ..., k and j 1, ..., m+1 . It is ≡ ≡ `,j ∈ { } ∈ { } the combination of appropriately timed free-evolution pe- τ1 τ2 τ3 τm riods with specific unitary operations (rather than simple bit flips as in standard dynamic decoupling), that allows FIG. 14. Dynamic decoupling sequence composed of uni- the decoupling of the unwanted ZZ interaction while im- taries Eq. 105, with arbitrary inter-pulse separation times plementing a non-identity operation. τi = ti − ti−1, for i ∈ {1, ..., m}, resulting in a total duration Pm Following the procedure described in Sec. III C 1, the τ = i=1 τi. Here the different colours are used to indicate timing, rotation, and phase variables form the basis for non-uniformity of the unitaries Pi, applied at times ti. defining the array of generalized controls v, appropriately normalized for efficient TensorFlow optimization. We The optimizer returns variations on the circuit struc- also introduce an experimentally motivated constraint ture composed of compound rotations on different qutrit in that the circuit must not exceed the qutrit coherence levels with variable timing between these operations. The time, set by T1. We therefore compose the cost function combination of driven rotations and their timing in the 37 sequence is essential in performing the target net unitary hardware that can introduce dynamics in measurements with low infidelity; compactifying the circuit structure that are not captured by simple averaging. The tools we in order to reduce nominal dead time changes the cross- are building include features for Gaussian Process Re- talk-suppressing nature of the circuit. In the example gression and Autoregressive Kalman Filtering [35], tar- optimization realized in Fig. 13 we are able to improve geting both data fitting for the removal of background the cross-talk limited fidelity (1 optimal) in the target dynamics [132] and also predictive estimation for feedfor- unitary from 2.2% (under the− Isimplest compilation, ward control stabilization of qubits and clocks [81]. These without any form∼ of dynamic cross-talk suppression) to time-domain analytic frameworks are also useful for data 99.4%. fusion incorporating multiple measurement streams from This demonstration validates the premise of circuit- sensors or measured qubits. level optimization in order to realize deterministic error Similarly, we will be implementing novel automated robustness. Treating hardware-aware circuit compilation and adaptive strategies for the tuneup, calibration, and as a challenge in optimal control - for either deterministic optimization of mesoscale systems, moving beyond the error suppression or decomposition of a complex circuit brute-force strategy of independent calibration of all de- into a constrained set of physical-layer controls - is a fea- vices. In this space, advanced machine learning, rein- ture set incorporated in the forthcoming FIRE OPAL forcement learning, and robotic control concepts provide package. new opportunities to facilitate rapid, autonomous bring up of devices in a way that will grow in importance as sys- tem sizes increase. We already have considerable effort V. CONCLUSION AND OUTLOOK in this area, taking inspiration from autonomous robotic control to facilitate adaptive measurement and data in- In this manuscript we have provided an overview of ference on large qubit arrays [36, 133], and will be invest- a new toolset built to allow users to incorporate quan- ing heavily in this area in the future. tum control into their research and application devel- By combining novel advances in quantum control en- opment. The software architecture combines locally in- gineering with high-efficiency algorithmic development, stalled packages coupled with a cloud-compute engine we hope these tools will prove a valuable resource for a in order to deliver computational benefits for complex wide range of users. We believe that the integration of computations such as control optimizations. The specific highly maintainable, professionally engineered software products we introduced range from intuitive web inter- solutions targeting specialized tasks in the quantum com- faces with interactive visualizations through to advanced puting stack will ultimately provide major benefits to the python toolkits for integration into professional program- research and business communities, much like the intro- ming and hardware, tageting a range of users from con- duction of specialist cloud security software has acceler- sultants and students through to hardware R&D teams. ated many aspects of cloud-service businesses. As background, we have provided a thorough mathe- matical treatment of key tasks and approaches in quan- tum control - including the introduction of new tech- ACKNOWLEDGEMENTS niques developed by our team - and describe how they are implemented algorithmically in software. We con- Q-CTRL efforts supported by Data Collective, Hori- textualized these capabilities through a series of theo- zons Ventures, Main Sequence Ventures, Sequoia Cap- retical case studies demonstrating the utility of these ital (China), Sierra Ventures, and SquarePeg Capital. software capabilities in solving challenging problems in Development of multi-dimensional filter functions and quantum control. In addition, we provided experimental SVD spectrum inversion technique by Q-CTRL sup- evidence derived from real quantum computing hardware ported by the US Army Research Office under Contract demonstrating quantum-control benefits such as suppres- W911NF-12-R-0012. Q-CTRL is grateful to I. Siddiqi sion of noise susceptibility, error homogenization in mul- and D. Santiago for provision of device data which in- tiqubit devices, gate-fidelity stabilization in time, and spired circuit optimization results. Experimental work noise-spectroscopy in multiqubit gates. using trapped ions at USYD partially supported by the Future development will expand functionality to inte- ARC Centre of Excellence for Engineered Quantum Sys- grate novel machine-learning tools for data analysis and tems CE170100009,the Intelligence Advanced Research hardware characterization at scale. For instance, we are Projects Activity (IARPA) through the US Army Re- investigating a number of time-series analysis techniques search Office Grant No. W911NF-16-1-0070, and a pri- which enable the identification and extraction of sys- vate grant from H. & A. Harley. tem dynamics from discretized measurement records. It’s The authors are grateful to all other colleagues at Q- common practice in quantum computing experiments to CTRL whose technical and design work has supported simply average together large data sets in order to obtain the results presented in this paper. Backend: Kevin probabilistic information about e.g. quantum-state pop- Nguyen, Ryan Barker, Stefano Tabacco and Luigi Cristo- ulations in algorithms. This procedure, however, is con- folini. Frontend: Rob Harkness and Yashar Zolmajdi. founded by the presence of large-scale temporal drifts in Design: Damien Metcalf and Christina Maresca. Quan- 38 tum engineering: Viktor Perunicic for assistance demon- strating and describing the visualizer. 39

Appendix A: Technical definitions

1. Frobenius inner product and Frobenius norm

m n For matrices A, B C × , the Frobenius inner product is defined as ∈ A, B F = A∗ Bij = Tr A†B (A1) h i ij i,j X  m n The inner product in Eq. A1 induces a matrix norm. For a matrix A C × , the Frobenius norm is defined by ∈ 2 A = A, A F = Aij = Tr (A A) (A2) k kF h i | | † i,j p sX q

2. Fourier transform

In this paper we exclusively use the non-unitary angular-frequency convention for Fourier transform pairs, defining

∞ iωt Q(ω) dte− Q(t) (A3) ≡ Z−∞ 1 ∞ Q(t) dωeiωtQ(ω) (A4) ≡ 2π Z−∞ where Q(t) denotes any scalar-, matrix- or operator-valued function of time, and Q(ω) is its Fourier transform, implemented element-wise for matrices. For ease of notation we reuse the same symbol and simply change the argument to distinguish time- or frequency-domain transforms. To avoid confusion we also write F Q(t) (ω) Q(ω) 1 { } ≡ and F − Q(ω) (t) Q(t). { } ≡

3. Power spectral density

Here we develop the relationship between noise processes in the time-domain and their frequency-domain repre- sentations. Let βk(t) for k 1, ..., n denote a set of scalar-valued noise fields. Using the definition for the Fourier transform set out in App. A∈ 2, { we establish} the following relationships between time- and frequency-domain variables

1 ∞ iωt βk(t) = dωe βk(ω), (A5) 2π Z−∞ ∞ iωt βk(ω) = dte− βk(t). (A6) Z−∞ We assume the noise fields are independent[134], zero-mean random variables. The cross-correlation functions conse- quently vanish, namely

βj(t )β∗(t ) = 0, j = k 1, .., n (A7) h 1 k 2 i 6 ∈ { } where the angle brackets denote an ensemble average over the stochastic variables. The frequency-domain variables inherit the equivalent property, namely

βj(ω )β∗(ω ) = 0, j = k 1, .., n , (A8) h 1 k 2 i 6 ∈ { } which may be shown by substituting in Eq. A6, and invoking Eq. A7. We further assume the noise processes are wide sense stationary, implying the autocorrelation functions, defined as

Ck(t t ) βk(t )β∗(t ) , i 1, .., n , (A9) 2 − 1 ≡ h 1 k 2 i ∈ { } depend only on the time difference τ = t t . Under these conditions the autocorrelation function for each noise 2 − 1 field may be related to its power spectral density Si(ω) using the Wiener-Khinchin Theorem [135]. Specifically,

1 ∞ iω(t2 t1) Ck(t t ) = Sk(ω)e − dω, (A10) 2 − 1 2π Z−∞ 40 which is consistent with defining the power spectral density as

1 2 Sk(ω) βk(ω) . (A11) ≡ 2π | | D E To show this observe

∗ ∞ iω1t1 ∞ iω2t2 βk(ω )β∗(ω ) = dt e− βk(t ) dt e− βk(t ) (A12) h 1 k 2 i 1 1 2 2 Z−∞  Z−∞   ∞ ∞ iω2t2 iω1t1 = dt dt βk(t )β∗(t ) e e− (A13) 1 2 h 1 k 2 i Z−∞ Z−∞

∞ ∞ 1 ∞ iω(t2 t1) iω2t2 iω1t1 = dt dt Sk(ω)e − dω e e− (A14) 1 2 2π Z−∞ Z−∞  Z−∞  1 ∞ ∞ i(ω+ω1)t1 ∞ i(ω+ω2)t2 = dωSk(ω) dt e− dt e (A15) 2π 1 2 Z−∞ Z−∞ Z−∞ 1 ∞ = dωSk(ω) 2π δ(ω + ω ) 2π δ( ω + ω ) (A16) 2π · 1 · − 2 Z−∞   0 ω = ω = 1 6 2 (A17) (2πSk(ω1) ω1 = ω2 41

Appendix B: Formal definition of the control Hamiltonian

As outlined in the main text, the central objectives of quantum control is to enhance the performance of a quantum system by leveraging the available controls against the influence of relevant noise sources. Delivering this for arbitrary quantum systems (qubits, qutrits, multi-qubit ensembles, etc.) requires a generalized formalism for describing the control Hamiltonian. In this appendix we introduce this formalism.

1. Generalized formalism

Let be a d-dimensional Hilbert space for the controlled quantum system. The control Hamiltonian is written H d s

H (t) = γj(t)Cj + H.C. + αl(t)Al + D (B1) ctrl   j=1 l X X=1   in terms of the control operators Al,Cj,D and control pulses (waveforms) αl(t) R and γj(t) C. To unpack this notation we introduce the nomenclature∈ H of drives, shifts and drifts, useful for∈ mapping generalized∈ quantum control concepts to common physical control variables. These are detailed in Table IV. In this framework, system evolution under Hctrl may be viewed as a combination of generalized rotations, driven by control pulses (real or complex) about effective control axes, defined by the associated operators.

control term operator pulse

drive Cj non-Hermitian γj (t) C: complex shift Al Hermitian αl(t) R: real drift D Hermitian -- symbol type symbol type

TABLE IV. Decomposition of control Hamiltonian into generalized drive, shift and drift terms. Drive terms are defined by † non-Hermitian operators, Cj 6= Cj , and complex-valued control pulses γj (t). Shift terms are defined by Hermitian operators, † Al = Al , and real-valued control pulses αl(t). The operator D is a time-independent Hermitian operator, which we refer to as the drift Hamiltonian.

2. Control solutions

Assuming the operator basis defined above, the control Hamiltonian may be expressed more compactly as

Hctrl(t) = γ(t)C + H.C. + α(t)A + D (B2)   in terms of the vectorized objects defined by

C1 C2 drive terms: γ(t) = γ1(t), γ2(t), . . . γd(t) , C =  .  , t [0, τ] (B3) . ∈     Cd     A1 A2 shift terms: α(t) = α1(t), α2(t), . . . αs(t) , A =  .  , t [0, τ] (B4) . ∈     As     with drive and shift pulses listed as complex and real row vectors respectively, and corresponding drive and shift operators listed as column vectors. Given the operator-basis defined by A and C, the most general description of control is therefore specified by the set of functions α(t) and γ(t), defined on the time interval t [0, τ], defining the duration over which the control is applied. We refer to this structure as a control solution. ∈ 42

3. Control segments

It is often more useful to specify the form of the control Hamiltonian, or functional form of the control pulses γ(t) and α(t), locally in time. In this case the time-domain t [0, τ] is partitioned into a series of intervals, or segments. The functional form of the control pulses are then defined∈ on each segment. This is illustrated below for a shift pulse αj(t). The time domain t [0, τ] has been formally partitioned into m subintervals ∈ [ti 1, ti], i 1, ..., m , t0 0, tm τ (B5) − ∈ { } ≡ ≡ where ti 1 and ti are respectively the start and end times of the ith segment, and −

τi = ti ti 1 (B6) − − is its duration. The shift pulse αj(t) is piecewise-constant, defined to take the constant value αi,j on the ith segment, t [ti 1, ti]. ∈ −

α3,j

α1,j αm,j α2,j θ3,j Aj : α θ1,j m−1,j θm,j θ2,j θm−1,j // t

τ1 τ2 τ3 τm−1 τm

0 t1 t2 t3 tm−2 tm−1 τ

t0 tm

FIG. 15. Segmentation of control amplitude αj (t) for control axis Aj into m segments. The area under the ith segment is given by the variable θi,j ≡ αi,j τj .

4. Generic shaped control segments

It may not always be desirable to treat each segment as constant-valued, as illustrated in Fig. 15. To facilitate a more general description of pulse shaping on a given segmentation in time, we introduce some further notation. Let the time domain be partitioned into m segments, and define the window function on the ith segment by

1 t [ti 1, ti] Θi(t) = ∈ − . (B7) (0 else Let f(t) be a scalar or vector function of time, locally defined on the ith segment by

fi(t) = Θi(t)f(t) i 1, ..., m (B8) ∈ { } such that m

f(t) = fi(t). (B9) i=1 X This partitioning define the map

f1(t) f2(t) S : f(t)  .  (B10) 7→ .   fm(t)     43 which we refer to as the segments of f(t). Using this notation we define the drive control segments

γ1,1(t) γ1,2(t) . . . γ1,d(t) γ2,1(t) γ2,2(t) . . . γ2,d(t) S(γ(t)) =  . . . .  , γi,j(t) Θi(t)γj(t) (B11) . . .. . ≡   γm,1(t) γm,2(t) . . . γm,d(t)    

α1,1(t) α1,2(t) . . . α1,s(t) α2,1(t) α2,2(t) . . . α2,s(t) S(α(t)) =  . . . .  , αi,l(t) Θi(t)αl(t) (B12) . . .. . ≡   αm,1(t) αm,2(t) . . . αm,s(t)     where the doubly-subscripted functions γi,j(t) and αi,l(t) define the time-dependent modulation envelopes for the jth phasor and lth amplitude on the ith segment. Each column maps to a distinct control, while each row maps a distinct segment. The segments of the control Hamiltonian are given by

Hctrl,1(t) Hctrl,2(t) S(Hctrl(t)) =  .  (B13) .   Hctrl,m(t)     where the control Hamiltonian on the ith segment is given by

Hctrl,i(t) = S(γ(t)) C + H.C. + S(α(t)) A + D (B14) i i h d i  h s i

= γi,j(t)Cj + H.C. + αi,l(t)Al + D. (B15)   j=1 l X X=1   Control is therefore completely specified by the m (d + s) functions tabulated in the time-dependent control-space array as ×

γ (t) γd(t) α (t) αs(t) − 1 ··· 1 ··· τ1 γ1,1(t) . . . γ1,d(t) α1,1(t) . . . α1,s(t)  ......  (B16) ......    τm γm,1(t) . . . γm,d(t) αm,1(t) . . . αm,s(t)     

5. Control coordinates

Here we introduce notation conventions followed by Q-CTRL to define drive pulses, their decomposition, and their relationship to Hermitian and non-Hermitian control operators. Since the following structure applies to every pulse- operator pair (γj(t),Cj), we drop the subscript j for simplicity. The complex-valued pulse γ(t) C may be written in polar or Cartesian form. Namely, ∈

Polar form: γ(t) = Ω(t)e+iφ(t) (B17) Cartesian form: γ(t) = I(t) + iQ(t) (B18) allowing us establish the following control forms

modulus: Ω(t) = γ(t) (B19) | | phase: φ(t) = Arg (γ(t)) (B20) in-phase: I(t) = Re (γ(t)) = Ω(t) cos(φ(t)) (B21) in-quadrature: Q(t) = Im (γ(t)) = Ω(t) sin(φ(t)) (B22) 44 where the drive phase φ(t) = +Arg(γ(t)) is defined as the positive argument. The drive term in the control Hamiltonian is therefore expressed

γ(t)C + H.C. = γ(t)C + γ∗(t)C† (B23)

= I(t) + iQ(t) C + I(t) iQ(t) C† (B24) −     = I(t) C + C† + Q(t) iC iC† (B25) − = I(t)A I + Q(t)AQ  (B26) where we have defined the Hermitian operators

AI = C + C†,AQ = i(C C†). (B27) −

Each drive term therefore decomposes into a pair of shift-terms (I(t),AI ) and (Q(t),AQ) in the familiar form of quadrature controls. These are related to the non-Hermitian operator as 1 C = (AI iAQ) (B28) 2 − The modulus Ω(t) sets the rotation rate, while the phase φ(t) sets the direction of rotation, oriented between the control axes defined by (AI ,AQ). 45

Appendix C: Derivation of multidimensional filter functions

1. Magnus expansion

The first few Magnus terms are computed as [89, 90]

τ Φ1(τ) = dtH˜noise(t) (C1) Z0 i τ t1 Φ (τ) = dt dt H˜ (t ), H˜ (t ) (C2) 2 −2 1 2 noise 1 noise 2 Z0 Z0 1 τ t1 t2  Φ (τ) = dt dt dt H˜ (t ), H˜ (t ), H˜ (t ) + H˜ (t ), H˜ (t ), H˜ (t ) (C3) 3 6 1 2 3 noise 1 noise 2 noise 3 noise 3 noise 2 noise 1 Z0 Z0 Z0 .       . The Magnus series establishes a framework to define error cancellation order. Implementing a control with fidelity defined in Eq. 16 up to order α means choosing controls such that Φk(τ) 0 for all k α. We now describe a useful ≈ ≤ framework for computing the Φα(τ) in the Fourier domain using filter functions, as expressed in Eq. 28. Using the definition for the Fourier transform set out in App. A 3, we have

1 ∞ iωt βk(t) = dωe βk(ω), (C4) 2π Z−∞ 1 ∞ iωt N 0 (t) = dωe N 0 (ω). (C5) k 2π k Z−∞ Substituting into Eq. 27 we therefore obtain p ∞ 1 ∞ iω1t 1 ∞ iω2t Φ (τ) = dt dω e N 0 (ω ) dω e βk(ω ) (C6) 1 2π 1 k 1 2π 2 2 k X=1 Z−∞  Z−∞   Z−∞  2 p 1 ∞ ∞ ∞ iω1t iω2t = dω dω N 0 (ω )βk(ω ) dte e (C7) 2π 1 2 k 1 2 k   X=1 Z−∞ Z−∞ Z−∞ 2 p 1 ∞ ∞ = dω dω N 0 (ω )βk(ω ) 2πδ( ω ω ) (C8) 2π 1 2 k 1 2 · − 2 − 1 k   X=1 Z−∞ Z−∞ where δ(x) is the Dirac delta function. Consequently

p 1 ∞ Φ (τ) = dω N 0 ( ω )βk(ω ) (C9) 1 2π 2 k − 2 2 k=1 Z−∞ Xp 1 ∞ = dωGk(ω)βk(ω) (C10) 2π k X=1 Z−∞ where we have defined

∞ iωt Gk(ω) N 0 ( ω) dte N 0 (t). (C11) ≡ k − ≡ k Z−∞

2. Leading order robustness infidelity in terms of filter functions

The leading-order error action operator Eq. 25 may be Taylor expanded as

˜ 1 2 Unoise(τ) = I iΦ1 Φ + ... (C12) − − 2 1 1 = I iΦ1 Φ1Φ† + ... (C13) − − 2 1 46 where we have used the property that the Magnus terms are Hermitian. Substituting into Eq. 16 the leading order contribution to the robustness fidelity takes the form

1 1 2 robust(τ) = Tr P I iΦ1 Φ1Φ† + ... (C14) F Tr (P ) − − 2 1 *    +

1 1 2 Tr (P ) iTr (P Φ ) Tr P Φ Φ† . (C15) ≈ Tr (P ) − 1 − 2 1 1 *    +

Due to our choice of gauge transformation in Eq. 24, we additionally use the property that Tr (P Φ1) = 0, yielding

1 1 2 (τ) = 1 Tr P Φ Φ† (C16) Frobust − Tr (P ) 2 1 1 *   +

1 1 ∗ 1 1 = 1 Tr P Φ Φ† 1 Tr P Φ Φ† (C17) − Tr (P ) 2 1 1 − Tr (P ) 2 1 1       2 1 4 = 1 Tr P Φ Φ† + Φ (C18) − Tr (P ) 2 1 1 O | 1|      where the last line uses the result that Tr P Φ1Φ1† is real-valued, following from the Hermiticity of Φ1. Ignoring terms beyond Φ 2 , and observing the ensemble average over noise-realizations only affects terms dependent on O | 1| Φ1, we therefore obtain (τ) = 1 (τ) (C19) Irobust − Frobust 2 Tr P Φ Φ† (C20) ≈ 2Tr (P ) 1 1 1 D  E = Tr P Φ Φ† . (C21) Tr (P ) 1 1  D E We may now explicitly calculate this term, substituting Eq. 28 into Eq. 26 we obtain

p p 2 1 ∞ ∞ Φ (τ)Φ†(τ) = dω dω Gi(ω )G†(ω ) βi(ω )β∗(ω ) (C22) 1 1 2π 1 2 1 j 2 1 j 2 i=1 j=1 D E X X   Z−∞ Z−∞ p 2 1 ∞ ∞ = dω dω Gk(ω )G† (ω ) βk(ω )β∗(ω ) (C23) 2π 1 2 1 k 2 h 1 k 2 i k=1   Z−∞ Z−∞ Xp 1 ∞ = dωGk(ω)G† (ω)Sk(ω) (C24) 2π k k X=1 Z−∞ where in the second line we invoke the independence property of the frequency-domain variables βi,j(ω) defined by Eq. A8, and in the third line we use Eq. A17. Substituting into Eq. 26 we therefore obtain

p ∞ dω 1 (τ) Tr PGk(ω)G† (ω) Sk(ω) (C25) Irobust ≈ 2π Tr (P ) k k X=1 Z−∞    47

Appendix D: Optimization benchmarking

In this appendix we provide additional details regarding the performance benchmarking of the Q-CTRL optimization engine.

1. Optimization tools

Four different optimization tools were compared: NumPy: A simple in-house implementation of gradient-based pulse optimization, using mostly vectorized NumPy functions for calculating the system time evolution, the operational infidelity and the gradient of the infidelity, for given piecewise-constant control segments. The SciPy [136] implementation of the L-BFGS- B algorithm (via the scipy.optimize.minimize function with default arguments) was used to perform the optimization updates. QuTiP: The QuTiP [99, 100] implementation of the gradient ascent pulse engineering algorithm. The create pulse optimizer function was called with the physical parameters defining the system (controls, drift, duration, target, segment count, and pulse bounds), with the dyn type parameter set to ‘UNIT’, and convergence conditions consistent with the other tools used in the comparison (max iter=100000, max wall time=1800, fid err targ=0, and min grad=1e-5). All controls were scaled to have pulse bounds of [ 1, 1] prior to being passed to the function, to ensure the default pulse scaling value of 1.0 was suitable. The− resulting Optimizer object was then used to perform all necessary optimization runs (for the given system configuration). Q-CTRL (local): The Q-CTRL implementation of gradient-based pulse optimization, running on the same hardware as the NumPy and QuTiP tools. Note that the optimization updates were performed using the same SciPy L-BFGS-B algorithm as the NumPy optimizer described above (again with default arguments). Q-CTRL (cloud): Same as Q-CTRL (local), but running on cloud hardware with custom backend resource management.

2. Software and hardware versions

The following software versions were used: Base Docker image: jupyter/tensorflow-notebook:2c0af4ab516b [137] libopenblas: 0.3.7 (installed from Anaconda [138]) NumPy: 1.18.4 (installed from Anaconda) SciPy: 1.4.1 (installed from Anaconda) Cython: 0.29.19 (installed from Anaconda) TensorFlow: 2.2.0 (installed from PyPI [139]) QuTiP: 4.4.1 (installed from PyPI) Optimizations using local-instance code—NumPy, QuTiP and Q-CTRL (local)—were all run on a single dedicated machine with a 2.30 GHz 4-core Intel R Xeon R CPU and 16 GB RAM (note that this machine was running in the cloud and accessed remotely). The Q-CTRL (cloud) optimizations were run on a cluster of 20 machines, each with a 2.30 GHz 4-core Intel R Xeon R CPU, an NVIDIA R T4 GPU, and 16 GB RAM.

3. Physical systems

In all cases, for each of the two physical system configurations below, 20 optimization runs were performed with randomly-generated initial seed solutions. The numbers of objective function evaluations and the final obtained infidelities were compared qualitatively to ensure approximate consistency. 48

a. Single controllable qubit in four-qubit space

For the comparison of optimizer performance against number of control segments, we used a system consisting of four qubits, with full three-axis control of a single qubit (note that while this system is separable, and thus could be solved efficiently by optimizing the controllable qubit in isolation, none of the tools were configured to take advantage of this fact). Specifically, we used the Hamiltonian:

I(t) 3 Q(t) 3 α(t) + ν 3 H(t) = σx I⊗ + σy I⊗ + σz I⊗ , 2 ⊗ 2 ⊗ 2 ⊗ where σ x,y,z are the Pauli operators, I(t),Q(t), α(t) are optimizable controls, and ν is a constant dephasing drift. The optimizations{ } were performed with the following parameters:

3 Target gate: H I⊗ (Hadamard on first qubit) ⊗ Gate duration: 0.5 s Pulse bounds: α(t) 2π 2 Hz and I(t) + iQ(t) 2π 2 Hz (note that QuTiP does not support this type of complex constraint,| | so≤ the× relaxed constraint| I(t)| ≤, Q(t×) 2π 2 Hz was used instead) | | | | ≤ × Dephasing: ν = 2π 1 Hz × In this case, system complexity was tuned by varying the number of segments used for the piecewise-constant pulses I(t),Q(t), α(t), between 10 and 500. This segment count maps directly to the dimensionality of the optimization search space (there are three controls, so for m segments per control there are 3m optimizable parameters), and to the computational complexity of calculating the system dynamics.

b. Linear array of Rydberg atoms

For the comparison of optimizer performance against number of qubits, we used a system consisting of a linear array of Rydberg atoms, with controllable global coupling and detuning. The Hamiltonian for the system, assuming an array of N atoms, is[140]:

N n N Ω(t) (i) (i) (i) V (i) (j) H(t) = σ ∆(t) n δin + n n , 2 x − − 6 i=1 i=1 i=1 i

Gate duration: 1.1 µs Pulse bounds: Ω(t) 2π 5 MHz and ∆(t) 2π 20 MHz | | ≤ × | | ≤ × Interaction strength: V = 2π 24 MHz × 2π 4.5 MHz for i = 1,N Detunings per-atom: δi = − × 0 for 2 i N 1 ( ≤ ≤ − Control segments: 40 segments each for piecewise-constant controls Ω(t) and ∆(t) In this case, system complexity was tuned by varying the number of atoms N from 2 to 8 (although results were not taken if the 20 optimizations were projected to take any more than roughly one hour, which was true for N = 7, 8 with the NumPy optimizer and for N = 8 with the QuTiP and Q-CTRL (local) optimizers). 49

Appendix E: Methods for experimental demonstrations of quantum-control benefits

1. Quasi-static error robustness

In Fig. 8b,c we implement a net Xπ gate using four different pulse constructions, with varying error-robustness properties: Primitive: no robustness (red). BB1 [120]: robust to pulse amplitude errors (purple). CORPSE [121]: robust to pulse detuning errors (cyan). CinBB [122]: robust to both pulse amplitude and detuning errors (blue). We compare the performance of all four against quasi-static errors in both the rotation angle (amplitude) and qubit frequency (detuning). A single trapped ion qubit is prepared in 0 and a sequence of Xπ pulses is applied to amplify | i the error. The probability of finding the qubit in the 1 state, P1, is then measured providing a proxy for the sequence infidelity (zero for error-free rotations). | i In Fig.I 8b, an over-rotation error is engineered by scanning the pulse length either side of the the π-time (the ideal value). For each error strength we measure P1 after implementing a sequence of 10 Xπ pulse. This sequence amplifies the effect of over-rotation errors. In Fig. 8c, an engineered detuning error is created by driving the qubit off-resonantly. The absolute frequency detuning is normalized by the Rabi rate to quantify a relative error that is varied between 10%. To amplify the effect of detuning errors we use an alternating sequence of 10 Xπ pulses. ± ±

2. Suppression of time-varying noise

The experimental filter function reconstructions shown in Fig. 8d,e in the main text were performed through the application of a single frequency disturbance at ωsid added to either the control or the dephasing quadrature. We denote these time-dependent noise fields with βk(t) with k Ω, z and our corresponding Hamiltonian reads ∈ { } H(t) = Hctrl(t)(1 + βΩ(t)) + βz(t)σz, (E1) where Hctrl(t) is the control Hamiltonian that represents the driven evolution through the microwave field, βΩ(t) is the amplitude noise and βz(t) is the dephasing noise. Typically, we write Hctrl(t) in a rotating frame with respect to the qubit splitting such that it takes the form of a time-dependent X- or Y -rotation with Ω(t) H (t) = (cos φ(t)σx + sin φ(t)σy), (E2) ctrl 2 where Ω(t) is the time-dependent Rabi rate and φ(t) is the control phase (see [110] for further details on the experi- mental system and the control synthesis). The noise fields take the explicit form of

βk(t) = αk cos(ω t + ϕ) for k Ω, z , (E3) sid ∈ { } where αk is a constant factor to set the modulation depth. Through averaging over phase parameter ϕ 0, 2π , ∈ { } this form of modulation produces a δ-function like noise spectrum Sk(ω) δ(ω ωsid) which, using the relationship χ dωS(ω)F (ω) allows us to directly extract the value of the filter function≈ at− the frequency ω [58, 110]. For the ∝ sid experiments here, we used αΩ = 0.25 and αz = 0.7 and the points were averaged over 5 values of ϕ spaced linearly betweenR 0 and 2π. Experimentally, this is achieved via amplitude and frequency modulation of the microwave field that drives the qubit transition. The amplitude noise is added digitally to the I/Q control waveforms before upload to the microwave signal generator (Keysight E8267D), such that we obtain a noisy drive waveform with Ω(t) Ω(t)(1 + β (t)). (E4) → Ω The dephasing noise is engineered through an additive term in the phase of the control Hamiltonian (Eq. E2). The total phase offset is formally split into a control and noise term: φ(t) φctrl(t) + φnoise(t). In the interaction picture defined by the frame transformation →

φnoise(t) H (t) = Uφ(t)†H (t)Uφ(t) U˙ φ(t)U †(t),Uφ(t) = exp i σz (E5) int ctrl − φ − 2   50 the total Hamiltonian takes the form

Ω(t)(1 + βΩ(t)) φ˙noise(t) H (t) = (cos φ(t)σx + sin φ(t)σy) σz. (E6) int − 2 − 2

Using our notation from Eq. E1, we can identify the dephasing noise term βz(t) = φ˙noise(t)/2. The corresponding dephasing noise waveforms are generated using an external arbitrary waveform generator (Keysight 33600A), whose output is fed into the analog FM port of the microwave generator, which produces the desired dephasing noise term. For more details, see chapter 2 in [110].

3. Error homogenization characterized via 10-qubit parallel randomized benchmarking

In Fig. 8f, we measure a spatially varying average error rate along a string of 10 trapped ion qubits (shown in Fig. 8f inset). In this system, ions are simultaneously addressed by a global microwave control field to drive global single- qubit rotations. However, due to a gradient in the strength of the microwave field, the qubits rotate with a spatially varying Rabi rate meaning that the control cannot be synchronously calibrated for all 10 qubits. Qubit 1 in the figure is used for calibration in this experiment, yielding the lowest error rate. Error is measured using parallel randomized benchmarking in which all ions are illuminated with microwaves simultaneously and experience the same RB sequence. The general approach to RB sequence construction and experimental implementation is described in detail in the supplemental material of Ref. [123]. Sequences here are composed of up to 500 operations selected from the Clifford set. Measurement is conducted using a spatially-resolved EMCCD (-multiplying CCD) camera in order to extract average error rates for each individual qubit. Given the relatively low quantum efficiency of this detection method, state-preparation and measurement (SPAM) errors are in the range of 3 5%, approximately an order of magnitude higher than achieved using single-qubit RB, as measured via an avalanche∼ − photodetector.

4. Mølmer-Sørensen drift measurements

In Fig. 8g-i, we compare two different constructions of phase-modulated two-qubit Mølmer-Sørensen gates, both designed to produce the entangled Bell state ( 00 i 11 ) /√2. The gates are implemented by illuminating two ions with a pair of orthogonal beams from a pulsed| laseri − near| i 355 nm, driving stimulated Raman transitions as described in [73]. The geometry of the beams enables coupling to the radial motional modes of the ions, which have approximate frequencies ωk/2π = (1.579, 1.498, 1.485, 1.398) MHz and are denoted from highest to lowest frequency by k = 1 to k = 4. One of the Raman beams is controlled by an acousto-optic modulator driven by a two-tone radio-frequency signal produced by an arbitrary waveform generator. This results in a bichromatic light field that off-resonantly drives the red and blue sideband transitions, creating the state-dependent force used in the gate. We modulate the phase of the driving force φ(t) by adjusting the phase difference between the red and blue frequency components, φ(t) = [φb(t) φr(t)] /2. After an initial− calibration of the mode frequencies and gate Rabi frequency, we repeatedly perform the entangling operations over a period of several hours without further calibration, alternating between the two different phase- modulated gate constructions (panel g vs i) in order to mitigate any systematic differences between measurements. The ions are optically pumped to 00 and the selected gate is performed by applying the Raman beams for a duration | i of 500 µs. For both constructions, the gate detuning set to 2 kHz from the k = 2 mode. In this configuration, only the k = 2 and k = 3 modes are significantly excited during− the operation. Each gate is repeated 500 times and the ion fluorescence measured after each repetition. We use a maximum likelihood procedure described in [73] to extract the state populations Pn, the probability of measuring n ions bright, for each set of repetitions. The first phase-modulated gate construction consists of four phase segments and is calculated to ensure modes k = 2 and k = 3 are de-excited at the conclusion of the operation. The second is calculated to provide additional robustness to low frequency noise affecting the closure of mode k = 2, which necessitates doubling the number of phase segments as per the analytic procedure outlined in [73]. The required gate Rabi frequencies are Ω = 2π 18.3 kHz and Ω = 2π 22.9 kHz, for the first and second gates, respectively. The laser amplitude required to produce× the desired Ω for a× particular gate construction is calibrated by fixing the amplitude of the single-tone Raman beam and varying the amplitude of the bichromatic beam. As the amplitude of the beam is increased, the populations P0 and P2 will converge to the point at which P0 = P2 0.5, indicating the creation of the Bell state and the correct laser amplitude. ≈ 51

Appendix F: Visualizations of noise and control in quantum circuits

Q-CTRL provides an advanced visual interface that enables users to compose quantum circuits (Fig. 16a and Fig. 17a) and interactively track state evolution subject using Bloch spheres and a visual representation of entan- glement based on correlation tetrahedra. These tools offer unique, interactive, 3-dimensional visualizations, assisting users to build intuition for key logical operations performed in quantum circuits. In our tools, an arbitrary sequence of single and multiqubit operations may be graphically composed or sequenced in python. The associated state evolution is calculated and displayed using interactive three.js objects. These may then be rendered in Q-CTRL products, or directly embedded in Jupyter notebooks or websites. Current visualization packages are limited to two-qubit subspaces, with forthcoming development expanding to larger circuits. As an example consider the time-domain evolution of the state of a single qubit subject to control. A series of gates is described by an ideal target Hamiltonian: 1 1 H = Ω(cos(φ)σx + sin(φ)σy) + ∆σz, (F1) tot 2 2 where, Ω is the Rabi rate, ∆ the detuning and σx,y,z are the standard Pauli matrices. Depicted in Fig. 16b is a snapshot of the state vector evolution (purple pointer, Fig. 16b) along its present trajectory (solid red line, Fig. 16b) given by the last Hadamard gate (highlighted through a dynamic indicator). The visualization is dynamic and evolves in time; a user can interact with a time-indication slider in order to move through the time sequence. Moreover the view of the Bloch sphere and its color palette may be adjusted by the user, allowing for a user to gain insights that may be challenging in a simple 2D representation. In this specific example, for instance, it becomes immediately obvious that a Hadamard gate has the action not only of transforming a state +z +x , but that it does so as a rotation about an axis tilted out of the equatorial plane of the Bloch sphere. | i → | i The visualizer module also provides a means by which one may intuitively explore the effect of noise on unitary operations performed within quantum circuits. Two noise channels are available: control-amplitude noise Ω Ω(1 + β); and ambient dephasing noise ∆ ∆ + η, where β is the fractional fluctuation away from the target driving→ rate Ω and η is a fluctuation away form→ the target detuning ∆. In this circumstance the ideal state evolution is perturbed by the presence of noise, as illustrated by a displaced trajectory on the Bloch sphere. Ultimately, the discrepancy between the final location of the state at the end of the circuit and the ideal transformation, illustrated by a dotted line, provides a clear visual representation of how noise reduces the fidelity of a unitary transformation. Producing an intuitive visual representation of entanglement poses a significant challenge due to the presence of non-classical correlations between quantum systems. The Q-CTRL visualizer provides an exact representation of a two-qubit system exhibiting entanglement and subject to unitary controls utilizing two Bloch spheres and three correlation tetrahedra. The Bloch spheres depict the standard Pauli observables corresponding to each of the qubits (Fig. 17b), given for qubits one and two respectively by:

X1 = σx I ,X2 = I σx , h ⊗ i h ⊗ i Y1 = σy I ,Y2 = I σy , h ⊗ i h ⊗ i Z1 = σz I ,Z2 = I σz . (F2) h ⊗ i h ⊗ i The surfaces of the Bloch spheres fully describe the space of separable states; the presence of any entanglement necessitates that the Bloch vectors shrink and the states move off of the Bloch sphere surfaces. For instance, in Fig. 17b, the magnitude of both Bloch vectors shrinks to zero following the first CNOT gate, as the system evolves into a maximally entangled Bell state as a result of this gate. We visually depict entanglement using a set of observables corresponding to correlations between pairs of Cartesian observables for the two qubits. The correlation value between the observables is given by:

V (AB) = σA σB σA I I σB , h ⊗ i − h ⊗ ih ⊗ i A, B X,Y,Z . (F3) ∈ { } The nine correlation-pairs are organized into three coordinate systems bounded by a tetrahedral geometry [141] given by the following axial arrangement of the observable pairs: (XX,YY,ZZ), (XY,YZ,ZX) and (XZ,YX,ZY ). For separable states all correlation values are zero and the visual indicator is set to the center of the tetrahedra. In the presence of non-zero entanglement, however, these visual indicators emerge from the origin of the correlation coordinate systems and grow towards the extrema of the convex hull for maximally entangled qubit pairs. The degree of entanglement is also visually represented using the concurrence C(ψ) defined as: C(ψ) = 2 00 ψ 11 ψ 01 ψ 10 ψ (F4) h | i h | i − h | i h | i

52

a Q1   

b Ideal evolution

Q1

c Evolution under noise

Q1

FIG. 16. Circuit evolution under noise. (a) The interactive Q-CTRL quantum circuit interface, paused during the second Hadamard gate (highlighted). (b) Evolution of the state vector (purple pointer) on the Bloch sphere, under ideal, noise-free conditions. The current trajectory on is highlighted in red (H-gate) which sequentially continues on the prior circuit evolution (purple). (c) Evolution of the state in the presence of two noise channels: control amplitude (β) and ambient dephasing (η). The cumulative error in the qubit state (dashed red) due to the presence of these noise channels is indicated by the dashed line, relative to the ideal target trajectory (green pointer). which varies between 0 (separable states) and 1 (maximally entangled) throughout the system evolution, and shown using a horizontal indicator. Maximally entangled states may traverse the correlation tetrahedra when local unitaries are applied to the individual qubits, but the Bloch vectors remain at the centers of the Bloch spheres. Once again, noise processes may be added to the system’s evolution in order to represent how the presence of noise perturbs the entangled states.

[1] J. Preskill, Quantum 2, 79 (2018). A. Cross, J. Cruz-Benito, C. Culver, S. D. L. P. [2] G. Aleksandrowicz, T. Alexander, P. Barkoutsos, Gonz´alez, E. D. L. Torre, D. Ding, E. Dumitrescu, L. Bello, Y. Ben-Haim, D. Bucher, F. J. Cabrera- I. Duran, P. Eendebak, M. Everitt, I. F. Sertage, Hern´andez,J. Carballo-Franquis, A. Chen, C.-F. Chen, A. Frisch, A. Fuhrer, J. Gambetta, B. G. Gago, J. M. Chow, A. D. C´orcoles-Gonzales, A. J. Cross, J. Gomez-Mosquera, D. Greenberg, I. Hamamura, 53

a Q1

Q2

b Q1 Q2

c

FIG. 17. Visualization of two-qubit entangled states using BLACK OPAL. (a) Evolution of a two-qubit entangling circuit paused during a pair of gates (circled in red). (b) The trajectories of individual qubit observables depicting separable states are represented on an interactive 3D Bloch sphere. The bloch vector goes to zero as qubits become entangled through the action of the CNOT gate. (c) Three interactive entanglement tetrahedra track correlations between the nine pairs of observables enabling visual representation of complete two-qubit state evolution. Concurrence indicates the level of entanglement (red markers) between the qubits throughout the evolution of the circuit. Control and/or dephasing noise may be added to assist in understanding its impact on the evolution of entangled states.

V. Havlicek, J. Hellmers,Lukasz Herok, H. Horii, S. Hu, GitHub (accessed: 26-May-2020). T. Imamichi, T. Itoko, A. Javadi-Abhari, N. Kanazawa, [6] R. P. Feynman, International Journal of Theoretical A. Karazeev, K. Krsulich, P. Liu, Y. Luh, Y. Maeng, Physics 21, 467 (1982). M. Marques, F. J. Mart´ın-Fern´andez,D. T. McClure, [7] J. Hennessy and D. Patterson, Computer Architecture D. McKay, S. Meesala, A. Mezzacapo, N. Moll, D. M. (Morgan Kaufmann, 2017). Rodr´ıguez, G. Nannicini, P. Nation, P. Ollitrault, L. J. [8] K. M. Svore, A. V. Aho, A. W. Cross, I. Chuang, and O’Riordan, H. Paik, J. P´erez, A. Phan, M. Pistoia, I. L. Markov, Computer 39, 74 (2006). V. Prutyanov, M. Reuter, J. Rice, A. R. Davila, R. H. P. [9] N. C. Jones, R. Van Meter, A. G. Fowler, P. L. McMa- Rudy, M. Ryu, N. Sathaye, C. Schnabel, E. Schoute, hon, J. Kim, T. D. Ladd, and Y. Yamamoto, Phys. Rev. K. Setia, Y. Shi, A. Silva, Y. Siraichi, S. Sivarajah, J. A. X 2, 031007 (2012). Smolin, M. Soeken, H. Takahashi, I. Tavernelli, C. Tay- [10] A. S. Green, P. L. Lumsdaine, N. J. Ross, P. Selinger, lor, P. Taylour, K. Trabing, M. Treinish, W. Turner, and B. Valiron, SIGPLAN Not. 48, 333–342 (2013). D. Vogt-Lee, C. Vuillot, J. A. Wildstrom, J. Wilson, [11] D. Wecker and K. M. Svore, LIQUi|i: A software design E. Winston, C. Wood, S. Wood, S. W¨orner,I. Y. Akhal- architecture and domain-specific language for quantum waya, and C. Zoufal, Qiskit: An Open-source Frame- computing (2014), arXiv:1402.4467 [quant-ph]. work for Quantum Computing (2019). [12] A. JavadiAbhari, S. Patil, D. Kudrow, J. Heckey, [3] Microsoft quantum development kit, GitHub (accessed: A. Lvov, F. T. Chong, and M. Martonosi, in Proceed- 26-May-2020). ings of the 11th ACM Conference on Computing Fron- [4] Rigetti forest, GitHub (accessed: 26-May-2020). tiers, CF ’14 (Association for Computing Machinery, [5] A python framework for creating, editing, and invok- New York, NY, USA, 2014). ing Noisy Intermediate Scale Quantum (NISQ) circuits, [13] J. Heckey, S. Patil, A. JavadiAbhari, A. Holmes, 54

D. Kudrow, K. R. Brown, D. Franklin, F. T. Chong, [37] L. Viola and S. Lloyd, Phys. Rev. A 58, 2733 (1998). and M. Martonosi, SIGARCH Comput. Archit. News [38] L. Viola, S. Lloyd, and E. Knill, Phys. Rev. Lett. 83, 43, 445–456 (2015). 4888 (1999). [14] J. Heckey, S. Patil, A. JavadiAbhari, A. Holmes, [39] P. Zanardi, Phys. Lett. 258, 77 (1999). D. Kudrow, K. R. Brown, D. Franklin, F. T. Chong, [40] D. Vitali and P. Tombesi, Phys. Rev. A 59, 4178 (1999). and M. Martonosi, SIGPLAN Not. 50, 445–456 (2015). [41] L. Viola and E. Knill, Phys. Rev. Lett. 90, 037901 [15] J. Heckey, S. Patil, A. JavadiAbhari, A. Holmes, (2003). D. Kudrow, K. R. Brown, D. Franklin, F. T. Chong, and [42] M. S. Byrd and D. A. Lidar, Phys. Rev. A 67, 012324 M. Martonosi, in Proceedings of the Twentieth Inter- (2003). national Conference on Architectural Support for Pro- [43] A. G. Kofman and G. Kurizki, Phys. Rev. Lett. 93, gramming Languages and Operating Systems, ASPLOS 130406 (2004). ’15 (Association for Computing Machinery, New York, [44] K. Khodjasteh and D. A. Lidar, Phys. Rev. Lett. 95, NY, USA, 2015) p. 445–456. 180501 (2005). [16] P. Murali, N. M. Linke, M. Martonosi, A. J. Abhari, [45] W. Yao, R.-B. Liu, and L. J. Sham, Phys. Rev. Lett. N. H. Nguyen, and C. H. Alderete, in Proceedings of the 98, 077602 (2007). 46th International Symposium on Computer Architec- [46] G. Uhrig, Phys. Rev. Lett. 98, 100504 (2007). ture, ISCA ’19 (Association for Computing Machinery, [47] G. Gordon, G. Kurizki, and D. A. Lidar, Phys. Rev. New York, NY, USA, 2019) p. 527–540. Lett. 101, 010403 (2008). [17] T. H¨aner,D. S. Steiger, K. Svore, and M. Troyer, Quan- [48] K. Khodjasteh and L. Viola, Phys. Rev. Lett. 102, tum Science and Technology 3, 020501 (2018). 080501 (2009). [18] D. S. Steiger, T. H¨aner,and M. Troyer, Quantum 2, 49 [49] K. Khodjasteh and L. Viola, Phys. Rev. A 80, 032314 (2018). (2009). [19] Project Q (accessed: 11-May-2020). [50] K. Khodjasteh, D. A. Lidar, and L. Viola, Phys. Rev. [20] Project Q (accessed: 26-May-2020). Lett. 104, 090501 (2010). [21] D. C. McKay, T. Alexander, L. Bello, M. J. Biercuk, [51] W. Yang, Z.-Y. Wang, and R.-B. Liu, Frontiers Phys. L. Bishop, J. Chen, J. M. Chow, A. D. C´orcoles,D. Eg- 6, 1 (2010). ger, S. Filipp, J. Gomez, M. Hush, A. Javadi-Abhari, [52] H. K. Ng, D. A. Lidar, and J. Preskill, Phys. Rev. A 84, D. Moreda, P. Nation, B. Paulovicks, E. Winston, C. J. 012305 (2011). Wood, J. Wootton, and J. M. Gambetta, Qiskit back- [53] K. Khodjasteh and D. A. Lidar, Physical Review A 78, end specifications for OpenQasm and OpenPulse exper- 012355 (2008). iments (2018), arXiv:1809.03452 [quant-ph]. [54] M. J. Biercuk, H. Uys, A. P. VanDevender, N. Shiga, [22] A. W. Cross, L. S. Bishop, J. A. Smolin, and J. M. W. M. Itano, and J. J. Bollinger, Nature 458, 996 Gambetta, Open quantum assembly language (2017), (2009). arXiv:1707.03429 [quant-ph]. [55] J. Du, X. Rong, N. Zhao, Y. Wang, J. Yang, and R. B. [23] IBM Q Experience (accessed: 26-May-2020). Liu, Nature 461, 1265 (2009). [24] R. S. Smith, M. J. Curtis, and W. J. Zeng, A [56] H. Bluhm, S. Foletti, I. Neder, M. Rudner, D. Ma- practical quantum instruction set architecture (2016), halu, V. Umansky, and A. Yacoby, Nature Phys. 7, 109 arXiv:1608.03355 [quant-ph]. (2011). [25] Rigetti Computing, Quantum Error Mitigation with [57] S. Gustavsson, J. Bylander, F. Yan, P. Forn-D´ıaz, pyQuil, GitHub (accessed: 26-May-2020). V. Bolkhovsky, D. Braje, G. Fitch, K. Harrabi, [26] A. W. Cross, L. S. Bishop, S. Sheldon, P. D. Nation, D. Lennon, J. Miloshi, P. Murphy, R. Slattery, S. Spec- and J. M. Gambetta, Phys. Rev. A 100, 032328 (2019). tor, B. Turek, T. Weir, P. B. Welander, F. Yoshihara, [27] T. J. Tarn, G. Huang, and J. W. Clark, Mathematical D. G. Cory, Y. Nakamura, T. P. Orlando, and W. D. Modelling 1, 109 (1980). Oliver, Phys. Rev. Lett. 108, 170503 (2012). [28] J. W. Clark, D. G. Lucarelli, and T. J. Tarn, Int. J. [58] A. Soare, H. Ball, D. Hayes, J. Sastrawan, M. C. Jar- Mod. Phys. B 17, 5397 (2003). ratt, J. J. McLoughlin, X. Zhen, T. J. Green, and M. J. [29] D. Dong and I. Petersen, IET Control Theory and Ap- Biercuk, Nat. Phys. 10, 825 (2014). plications( 4, 1651 (2010). [59] F. K. Malinowski, F. Martins, P. D. Nissen, E. Barnes, [30] L. Bouten, R. V. Handel, and M. R. James, SIAM J. L. Cywinski, M. S. Rudner, S. Fallahi, G. C. Gardner, Control Optim. 46, 2199 (2007). M. J. Manfra, C. M. Marcus, and F. Kuemmeth, Nature [31] H. I. Nurdin, M. R. James, and I. R. Petersen, Auto- Nanotechnology (2016). matica 45, 1837 (2009). [60] U. Haeberlen and J. S. Waugh, Phys. Rev. 175, 453 [32] M. J. Biercuk, A. C. Doherty, and H. Uys, J. Phys. B (1968). 44, 154002 (2011). [61] S. Chaudhury, S. Merkel, T. Herr, A. Silberfarb, I. H. [33] T. J. Green, J. Sastrawan, H. Uys, and M. J. Biercuk, Deutsch, and P. S. Jessen, Phys. Rev. Lett. 99, 163002 New J. Phys. 15, 095004 (2013). (2007). [34] H. Ball and M. J. Biercuk, EPJ Quantum Technol. 2, [62] A. Smith, B. E. Anderson, H. Sosa-Martinez, C. A. Ri- 11 (2015). ofr´ıo,I. H. Deutsch, and P. S. Jessen, Phys. Rev. Lett. [35] R. S. Gupta and M. J. Biercuk, Phys. Rev. Applied 9, 111, 170502 (2013). 064042 (2018). [63] R. W. Heeres, P. Reinhold, N. Ofek, L. Frunzio, [36] R. S. Gupta, A. R. Milne, C. L. Edmunds, L. Jiang, M. H. Devoret, and R. J. Schoelkopf, Nature C. Hempel, and M. J. Biercuk, Autonomous adaptive Communications 8, 94 (2017). noise characterization in quantum computers (2019), [64] A. D. Tranter, H. J. Slatyer, M. R. Hush, A. C. Leung, arXiv:1904.07225 [quant-ph]. J. L. Everett, K. V. Paul, P. Vernaz-Gris, P. K. Lam, 55

B. C. Buchler, and G. T. Campbell, Nature Communi- [86] S. G. Schirmer, H. Fu, and A. I. Solomon, Phys. Rev. A cations 9, 4360 (2018). 63, 063410 (2001). [65] P. B. Wigley, P. J. Everitt, A. van den Hengel, J. W. [87] A. Kofman and G. Kurizki, Phys. Rev. Lett. 87, 270405 Bastian, M. A. Sooriyabandara, G. D. McDonald, K. S. (2001). Hardman, C. D. Quinlivan, P. Manju, C. C. N. Kuhn, [88] G. A. Paz-Silva and L. Viola, Phys. Rev. Lett. 113, I. R. Petersen, A. N. Luiten, J. J. Hope, N. P. Robins, 250501 (2014). and M. R. Hush, Scientific Reports 6, 25890 (2016). [89] S. Blanes, F. Cases, J. A. Oteo, and J. Ros, Phys. Rep. [66] B. M. Henson, D. K. Shin, K. F. Thomas, J. A. Ross, 470, 151 (2009). M. R. Hush, S. S. Hodgman, and A. G. Truscott, Pro- [90] W. Magnus, Commun. Pure and Appl. Math. 7, 649 ceedings of the National Academy of Sciences 115, (1954). 13216 (2018). [91] S. A. Caldwell and et al., Phys. Rev. Applied 10, 034050 [67] D. Hayes, K. Khodjasteh, L. Viola, and M. J. Biercuk, (2018). Phys. Rev. A 84, 062323 (2011). [92] M. Reagor, C. B. Osborn, N. Tezak, A. Staley, [68] K. Khodjasteh, J. Sastrawan, D. Hayes, T. J. Green, G. Prawiroatmodjo, M. Scheer, N. Alidoust, E. A. Sete, M. J. Biercuk, and L. Viola, Nature Communications N. Didier, M. P. da Silva, E. Acala, J. Angeles, A. Best- 4, 2045 (2013). wick, M. Block, B. Bloom, A. Bradley, C. Bui, S. Cald- [69] H. Ball, T. Nguyen, P. H. W. Leong, and M. J. Biercuk, well, L. Capelluto, R. Chilcott, J. Cordova, G. Cross- Phys. Rev. Applied 6, 064009 (2016). man, M. Curtis, S. Deshpande, T. El Bouayadi, D. Gir- [70] H. Qi, J. P. Dowling, and L. Viola, Quantum Informa- shovich, S. Hong, A. Hudson, P. Karalekas, K. Kuang, tion Processing 16 (2017). M. Lenihan, R. Manenti, T. Manning, J. Marshall, [71] D. Hayes, S. M. Clark, S. Debnath, D. Hucul, I. V. Y. Mohan, W. O’Brien, J. Otterbach, A. Papageorge, Inlek, K. W. Lee, Q. Quraishi, and C. Monroe, Phys. J.-P. Paquette, M. Pelstring, A. Polloreno, V. Rawat, Rev. Lett. 109, 020503 (2012). C. A. Ryan, R. Renzas, N. Rubin, D. Russel, M. Rust, [72] T. J. Green and M. J. Biercuk, Phys. Rev. Lett. 114, D. Scarabelli, M. Selvanayagam, R. Sinclair, R. Smith, 120502 (2015). M. Suska, T.-W. To, M. Vahidpour, N. Vodrahalli, [73] A. R. Milne, C. L. Edmunds, C. Hempel, F. Roy, T. Whyland, K. Yadav, W. Zeng, and C. T. Rigetti, S. Mavadia, and M. J. Biercuk, Physical Review Ap- Science Advances 4 (2018). plied 13 (2020). [93] N. Didier, E. A. Sete, M. P. da Silva, and C. Rigetti, [74] C. D. B. Bentley, H. Ball, M. J. Biercuk, A. R. R. Car- Phys. Rev. A 97, 022330 (2018). valho, M. R. Hush, and H. J. Slatyer, Numeric optimiza- [94] R. H. Byrd, P. Lu, J. Nocedal, and C. Zhu, SIAM Jour- tion for configurable, parallel, error-robust entangling nal on scientific computing 16, 1190 (1995). gates in large ion registers (2020), arXiv:2005.00366 [95] D. Lucarelli, Physical Review A 97 (2018). [quant-ph]. [96] Control hardware: pulse optimization under realistic ex- [75] Quantum Machines: Quantum Orchestration Plat- perimental constraints, Q-CTRL Application Note (ac- form, www.quantum-machines.co/platform (accessed: cessed: 22-Jun-2020). 11-May-2020). [97] T. Caneva, T. Calarco, and S. Montangero, Phys. Rev. [76] M. Werninghaus, D. J. Egger, F. Roy, S. Machnes, F. K. A 84, 022326 (2011). Wilhelm, and S. Filipp, Leakage reduction in fast su- [98] P. Doria, T. Calarco, and S. Montangero, Phys. Rev. perconducting qubit gates via optimal control (2020), Lett. 106, 190501 (2011). arXiv:2003.05952 [quant-ph]. [99] J. Johansson, P. Nation, and F. Nori, Computer Physics [77] K. Rudinger, S. Kimmel, D. Lobser, and P. Maunz, Communications 183, 1760 (2012). Phys. Rev. Lett. 118, 190502 (2017). [100] J. Johansson, P. Nation, and F. Nori, Computer Physics [78] S. Gustavsson, O. Zwier, J. Bylander, F. Yan, F. Yoshi- Communications 184, 1234 (2013). hara, Y. Nakamura, T. P. Orlando, and W. D. Oliver, [101] M. H. Goerz, D. Basilewitsch, F. Gago-Encinas, M. G. Physical Review Letters 110 (2013). Krauss, K. P. Horn, D. M. Reich, and C. P. Koch, Sci- [79] M. Jerger, A. Kulikov, Z. Vasselin, and A. Fedorov, Post Phys. 7, 80 (2019). Physical Review Letters 123 (2019). [102] Erik, L. Saldyt, Rob, J. Gross, tjproct, kmrudin, T. L. [80] J. Rutman, Proceedings of the IEEE 66, 1048 (1978). Scholten, msarovar, kevincyoung, R. Blume-Kohout, [81] S. Mavadia, V. Frey, J. Sastrawan, S. Dona, and M. J. pyIonControl, and D. Nadlinger, pygstio/pygsti: Ver- Biercuk, Nature Communications 8, 14106 (2017). sion 0.9.9.1 (2020). [82] Superconducting qubits: Improving measurement per- [103] F. Motzoi, J. M. Gambetta, P. Rebentrost, and F. K. formance, Q-CTRL Application Note (accessed: 22- Wilhelm, Phys. Rev. Lett. 103, 110501 (2009). Jun-2020). [104] T. J. Evans, R. Harper, and S. T. Flammia, Scalable [83] Superconducting qubits: pulse calibration: mapping bayesian hamiltonian learning (2019), arXiv:1912.07636 (I,Q) values onto hardware amplitude inputs, Q-CTRL [quant-ph]. Application Note (accessed: 11-May-2020). [105] S. Krastanov, S. Zhou, S. T. Flammia, and L. Jiang, [84] M. A. Rol, L. Ciorciaro, F. K. Malinowski, B. M. Quantum Science and Technology 4, 035003 (2019). Tarasinski, R. E. Sagastizabal, C. C. Bultink, [106] R. Harper, S. T. Flammia, and J. J. Wallman, Efficient Y. Salathe, N. Haandbaek, J. Sedivy, and L. DiCarlo, learning of quantum noise (2019), arXiv:1907.13022 Time-domain characterization and correction of on-chip [quant-ph]. distortion of control pulses in a quantum processor [107] G. A. Alvarez´ and D. Suter, Phys. Rev. Lett. 107, (2019), arXiv:1907.04818 [quant-ph]. 230501 (2011). [85] U. Haeberlen and J. S. Waugh, Phys. Rev. 175, 453 [108] D. Slepian, The Bell System Technical Journal 57, 1371 (1968). 56

(1978). [130] B. Adbo, L. Bishop, M. Brink, J. Chow, A. C´orcoles, [109] D. Slepian, SIAM Review 25, 379 (1983). A. Cross, J. M. Gambetta, O. Jinka, A. Kandala, [110] V. Frey, Ph.D. thesis, The University of Sydney, NSW S. Rosenblatt, J. Rozen, and M. Takita, IBM Q 5 Tener- 2006, Australia (2019). ife, GitHub (accessed: 11-May-2020). [111] H. B. Mitchel, Multi-sensor data fusion - an introduc- [131] Y. Shi, N. Leung, P. Gokhale, Z. Rossi, D. I. Schus- tion (Springer-Verlag Berlin Heidelberg, 2007). ter, H. Hoffmann, and F. T. Chong, Proceedings of the [112] S. Thrun, W. Burgard, and D. Fox, Intelligent Robotics Twenty-Fourth International Conference on Architec- and Autonomous Agents series (MIT Press, 2005). tural Support for Programming Languages and Operat- [113] Here the factor 1/2 implements the trapezoidal rule. ing Systems - ASPLOS ’19 (2019). [114] A technical discussion of how estimates and uncertain- [132] T. Proctor, M. Revelle, E. Nielsen, K. Rudinger, D. Lob- ties are computed for the various quantities described ser, P. Maunz, R. Blume-Kohout, and K. Young, De- here will be presented in future work. tecting, tracking, and eliminating drift in quantum in- [115] H. Y. Carr and E. M. Purcell, Phys. Rev. 94, 630 (1954). formation processors (2019), arXiv:1907.13608 [quant- [116] S. Meiboom and D. Gill, Review of Scientific Instru- ph]. ments 29, 688 (1958). [133] R. S. Gupta and M. J. Biercuk, Convergence analysis [117] P. Hansen, InviteComputational Inverse Problems in for autonomous adaptive learning applied to quantum Electrocardiography (WIT Press, 2000). architectures (2019), arXiv:1911.05752 [quant-ph]. [118] A. N. Tikhonov, Soviet Math. Dokl. (1963). [134] The assumption of independence is reasonable, for in- [119] D. L. Donoho, IEEE Transactions on information theory stance, in the case of a driving field where random fluc- 52, 1289 (2006). tuations in frequency and amplitude arise from differ- [120] S. Wimperis, Journal of Magnetic Resonance, Series A ent physical processes. A general model including cor- 109, 221 (1994). relations between noise processes is possible, however, [121] H. K. Cummins, G. Llewellyn, and J. A. Jones, Phys. following the approach outlined by Green et al. [33]. Rev. A 67, 042308 (2003). [135] S. L. Miller and D. Childers, Probability and Random [122] M. Bando, T. Ichikawa, Y. Kondo, and M. Nakahara, Processes with Applications to Signal Processing and Journal of the Physical Society of Japan 82, 014004 Communications (Academic Press, Boston, MA, 2012). (2013), https://doi.org/10.7566/JPSJ.82.014004. [136] P. Virtanen, R. Gommers, T. E. Oliphant, M. Haber- [123] C. L. Edmunds, C. Hempel, R. J. Harris, V. M. land, T. Reddy, D. Cournapeau, E. Burovski, P. Pe- Frey, T. M. Stace, and M. J. Biercuk, Dynamically terson, W. Weckesser, J. Bright, S. J. van der Walt, corrected gates suppress spatio-temporal error correla- M. Brett, J. Wilson, K. Jarrod Millman, N. Mayorov, tions as measured by randomized benchmarking (2019), A. R. J. Nelson, E. Jones, R. Kern, E. Larson, C. Carey, arXiv:1909.10727 [quant-ph]. I.˙ Polat, Y. Feng, E. W. Moore, J. Vand erPlas, D. Lax- [124] Superconducting qubits: improving the performance of alde, J. Perktold, R. Cimrman, I. Henriksen, E. A. Quin- single qubit gates, Q-CTRL Application Note (accessed: tero, C. R. Harris, A. M. Archibald, A. H. Ribeiro, 11-May-2020). F. Pedregosa, P. van Mulbregt, and S. . . Contributors, [125] J. T. Merrill and K. R. Brown, Progress in compensat- Nature Methods 17, 261 (2020). ing pulse sequences for quantum computation, in Quan- [137] jupyter/tensorflow-notebook:2c0af4ab516b docker im- tum Information and Computation for Chemistry (John age, Docker Hub (accessed: 10-June-2020). Wiley & Sons, Ltd, 2014) pp. 241–294. [138] Anaconda software distribution, Web (accessed: 10- [126] R. Schutjens, F. A. Dagga, D. J. Egger, and F. K. Wil- June-2020). helm, Phys. Rev. A 88, 052330 (2013). [139] Python package index, Web (accessed: 10-June-2020). [127] J. Koch, T. M. Yu, J. Gambetta, A. A. Houck, D. I. [140] A. Omran, H. Levine, A. Keesling, G. Semeghini, T. T. Schuster, J. Majer, A. Blais, M. H. Devoret, S. M. Wang, S. Ebadi, H. Bernien, A. S. Zibrov, H. Pichler, Girvin, and R. J. Schoelkopf, Phys. Rev. A 76, 042319 S. Choi, J. Cui, M. Rossignolo, P. Rembold, S. Mon- (2007). tangero, T. Calarco, M. Endres, M. Greiner, V. Vuleti´c, [128] J. Bylander, S. Gustavsson, F. Yan, F. Yoshihara, and M. D. Lukin, Science 365, 570 (2019). K. Harrabi, G. Fitch, D. G. Cory, Y. Nakamura, J.-S. [141] K. Modi, A. Brodutch, H. Cable, T. Paterek, and V. Ve- Tsai, and W. D. Oliver, Nat. Phys. 7, 565 (2011). dral, Rev. Mod. Phys. 84, 1655 (2012). [129] C. Ferrie, C. Granade, G. Paz-Silva, and H. M. Wise- man, New Journal of Physics 20, 123005 (2018).