PDF Documentation
Total Page:16
File Type:pdf, Size:1020Kb
QuTiP: Quantum Toolbox in Python Release 4.4.0 P.D. Nation, J.R. Johansson, A.J.G. Pitchford, C. Granade, A.L. Grimsmo, N. Shammah, S. Ahmed, N. Lambert, and E. Giguere Jul 02, 2019 Contents 1 Frontmatter 3 1.1 About This Documentation.....................................3 1.2 Citing This Project..........................................3 1.3 Funding................................................4 1.4 About QuTiP.............................................4 1.5 Contributing to QuTiP........................................5 2 Installation 7 2.1 General Requirements........................................7 2.2 Platform-independent Installation..................................7 2.2.1 Building your Conda environment.............................8 2.2.2 Adding the conda-forge channel..............................8 2.3 Installing via pip...........................................8 2.4 Installing from Source........................................9 2.5 Installation on MS Windows.....................................9 2.5.1 Windows and Python 2.7.................................. 10 2.6 Verifying the Installation....................................... 10 2.7 Checking Version Information using the About Function...................... 10 3 Users Guide 11 3.1 Guide Overview........................................... 11 3.1.1 Organization........................................ 11 3.2 Basic Operations on Quantum Objects................................ 12 3.2.1 First things first....................................... 12 3.2.2 The quantum object class.................................. 13 3.2.3 Functions operating on Qobj class............................. 18 3.3 Manipulating States and Operators................................. 21 3.3.1 Introduction......................................... 21 3.3.2 State Vectors (kets or bras)................................. 21 3.3.3 Density matrices...................................... 25 3.3.4 Qubit (two-level) systems.................................. 27 3.3.5 Expectation values..................................... 29 3.3.6 Superoperators and Vectorized Operators......................... 30 3.3.7 Choi, Kraus, Stinespring and 휒 Representations...................... 33 3.3.8 Properties of Quantum Maps................................ 38 3.4 Using Tensor Products and Partial Traces.............................. 39 3.4.1 Tensor products....................................... 39 3.4.2 Example: Constructing composite Hamiltonians...................... 40 3.4.3 Partial trace......................................... 42 3.4.4 Superoperators and Tensor Manipulations......................... 43 3.5 Time Evolution and Quantum System Dynamics.......................... 44 3.5.1 Dynamics Simulation Results................................ 44 3.5.2 Lindblad Master Equation Solver.............................. 46 3.5.3 Monte Carlo Solver..................................... 52 3.5.4 Stochastic Solver - Photocurrent.............................. 57 3.5.5 Stochastic Solver...................................... 59 3.5.6 Solving Problems with Time-dependent Hamiltonians................... 61 i 3.5.7 Bloch-Redfield master equation.............................. 70 3.5.8 Floquet Formalism..................................... 77 3.5.9 Permutational Invariance.................................. 84 3.5.10 Setting Options for the Dynamics Solvers......................... 86 3.6 Solving for Steady-State Solutions.................................. 87 3.6.1 Introduction......................................... 87 3.6.2 Steady State solvers in QuTiP............................... 88 3.6.3 Using the Steadystate Solver................................ 88 3.6.4 Additional Solver Arguments................................ 89 3.6.5 Example: Harmonic Oscillator in Thermal Bath...................... 90 3.7 An Overview of the Eseries Class.................................. 92 3.7.1 Exponential-series representation of time-dependent quantum objects.......... 92 3.7.2 Applications of exponential series............................. 94 3.8 Two-time correlation functions................................... 96 3.8.1 Steadystate correlation function.............................. 97 3.8.2 Emission spectrum..................................... 98 3.8.3 Non-steadystate correlation function............................ 99 3.9 Quantum Optimal Control...................................... 103 3.9.1 Introduction......................................... 103 3.9.2 Closed Quantum Systems.................................. 104 3.9.3 The GRAPE algorithm................................... 104 3.9.4 The CRAB Algorithm................................... 106 3.9.5 Optimal Quantum Control in QuTiP............................ 106 3.9.6 Using the pulseoptim functions............................... 107 3.10 Plotting on the Bloch Sphere..................................... 108 3.10.1 Introduction......................................... 108 3.10.2 The Bloch and Bloch3d Classes.............................. 108 3.10.3 Configuring the Bloch sphere................................ 118 3.10.4 Animating with the Bloch sphere.............................. 121 3.11 Visualization of quantum states and processes............................ 122 3.11.1 Fock-basis probability distribution............................. 123 3.11.2 Quasi-probability distributions............................... 124 3.11.3 Visualizing operators.................................... 127 3.11.4 Quantum process tomography............................... 129 3.12 Parallel computation......................................... 131 3.12.1 Parallel map and parallel for-loop............................. 131 3.12.2 IPython-based parallel_map................................ 133 3.13 Saving QuTiP Objects and Data Sets................................ 133 3.13.1 Storing and loading QuTiP objects............................. 133 3.13.2 Storing and loading datasets................................ 134 3.14 Generating Random Quantum States & Operators......................... 136 3.14.1 Random objects with a given eigen spectrum....................... 138 3.14.2 Composite random objects................................. 139 3.15 Modifying Internal QuTiP Settings................................. 139 3.15.1 User Accessible Parameters................................. 139 3.15.2 Example: Changing Settings................................ 140 3.15.3 Persistent Settings...................................... 140 4 API documentation 141 4.1 Classes................................................ 141 4.1.1 Qobj............................................. 141 4.1.2 QobjEvo........................................... 150 4.1.3 eseries............................................ 152 4.1.4 Bloch sphere........................................ 153 4.1.5 Cubic Spline........................................ 155 4.1.6 Non-Markovian Solvers.................................. 156 4.1.7 Solver Options and Results................................. 160 4.1.8 Permutational Invariance.................................. 164 ii 4.1.9 Distribution functions.................................... 168 4.1.10 Quantum information processing.............................. 169 4.1.11 Optimal control....................................... 174 4.2 Functions............................................... 195 4.2.1 Manipulation and Creation of States and Operators.................... 195 4.2.2 Functions acting on states and operators.......................... 218 4.2.3 Dynamics and Time-Evolution............................... 225 4.2.4 Visualization........................................ 254 4.2.5 Quantum Information Processing.............................. 262 4.2.6 Non-Markovian Solvers.................................. 268 4.2.7 Optimal control....................................... 269 4.2.8 Utility Functions...................................... 282 5 Change Log 291 5.1 Version 4.4.0 (July 03, 2019)..................................... 291 5.1.1 Bug Fixes.......................................... 291 5.2 Version 4.3.0 (July 14, 2018)..................................... 291 5.2.1 Improvements........................................ 291 5.2.2 Bug Fixes.......................................... 292 5.3 Version 4.2.0 (July 28, 2017)..................................... 292 5.3.1 Improvements........................................ 292 5.3.2 Bug Fixes.......................................... 293 5.4 Version 4.1.0 (March 10, 2017)................................... 293 5.4.1 Improvements........................................ 293 5.4.2 Bug Fixes.......................................... 293 5.5 Version 4.0.2 (January 5, 2017)................................... 293 5.5.1 Bug Fixes.......................................... 293 5.6 Version 4.0.0 (December 22, 2016)................................. 294 5.6.1 Improvements........................................ 294 5.6.2 Bug Fixes.......................................... 294 5.7 Version 3.2.0 (Never officially released)............................... 294 5.7.1 New Features........................................ 294 5.7.2 Improvements........................................ 294 5.7.3 Bug Fixes.......................................... 296 5.8 Version 3.1.0 (January 1, 2015):................................... 296 5.8.1 New Features........................................ 296 5.8.2 Bug Fixes.......................................... 297 5.9 Version 3.0.1 (Aug 5, 2014):..................................... 297 5.9.1 Bug Fixes.........................................