PDF Documentation
Total Page:16
File Type:pdf, Size:1020Kb
QuTiP: Quantum Toolbox in Python Release 4.3.0 P.D. Nation, J.R. Johansson, A.J.G. Pitchford, C. Granade, and A.L. Grimsmo Feb 26, 2019 Contents 1 Frontmatter 3 1.1 About This Documentation.....................................3 1.2 Citing This Project..........................................3 1.3 Funding................................................3 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............................. 17 3.3 Manipulating States and Operators................................. 20 3.3.1 Introduction......................................... 20 3.3.2 State Vectors (kets or bras)................................. 20 3.3.3 Density matrices...................................... 24 3.3.4 Qubit (two-level) systems.................................. 26 3.3.5 Expectation values..................................... 27 3.3.6 Superoperators and Vectorized Operators......................... 29 3.3.7 Choi, Kraus, Stinespring and 휒 Representations...................... 31 3.3.8 Properties of Quantum Maps................................ 36 3.4 Using Tensor Products and Partial Traces.............................. 37 3.4.1 Tensor products....................................... 37 3.4.2 Example: Constructing composite Hamiltonians...................... 39 3.4.3 Partial trace......................................... 40 3.4.4 Superoperators and Tensor Manipulations......................... 41 3.5 Time Evolution and Quantum System Dynamics.......................... 42 3.5.1 Dynamics Simulation Results................................ 42 3.5.2 Lindblad Master Equation Solver.............................. 44 3.5.3 Monte Carlo Solver..................................... 50 3.5.4 Solving Problems with Time-dependent Hamiltonians................... 56 3.5.5 Bloch-Redfield master equation.............................. 65 3.5.6 Floquet Formalism..................................... 71 i 3.5.7 Permutational Invariance.................................. 80 3.5.8 Setting Options for the Dynamics Solvers......................... 82 3.6 Solving for Steady-State Solutions.................................. 83 3.6.1 Introduction......................................... 83 3.6.2 Steady State solvers in QuTiP............................... 84 3.6.3 Using the Steadystate Solver................................ 84 3.6.4 Additional Solver Arguments................................ 85 3.6.5 Example: Harmonic Oscillator in Thermal Bath...................... 86 3.7 An Overview of the Eseries Class.................................. 88 3.7.1 Exponential-series representation of time-dependent quantum objects.......... 88 3.7.2 Applications of exponential series............................. 90 3.8 Two-time correlation functions................................... 92 3.8.1 Steadystate correlation function.............................. 93 3.8.2 Emission spectrum..................................... 94 3.8.3 Non-steadystate correlation function............................ 95 3.9 Quantum Optimal Control...................................... 99 3.9.1 Introduction......................................... 99 3.9.2 Closed Quantum Systems.................................. 100 3.9.3 The GRAPE algorithm................................... 100 3.9.4 The CRAB Algorithm................................... 102 3.9.5 Optimal Quantum Control in QuTiP............................ 102 3.9.6 Using the pulseoptim functions............................... 103 3.10 Plotting on the Bloch Sphere..................................... 104 3.10.1 Introduction......................................... 104 3.10.2 The Bloch and Bloch3d Classes.............................. 104 3.10.3 Configuring the Bloch sphere................................ 114 3.10.4 Animating with the Bloch sphere.............................. 116 3.11 Visualization of quantum states and processes............................ 117 3.11.1 Fock-basis probability distribution............................. 118 3.11.2 Quasi-probability distributions............................... 119 3.11.3 Visualizing operators.................................... 122 3.11.4 Quantum process tomography............................... 124 3.12 Parallel computation......................................... 126 3.12.1 Parallel map and parallel for-loop............................. 126 3.12.2 IPython-based parallel_map................................ 128 3.13 Saving QuTiP Objects and Data Sets................................ 129 3.13.1 Storing and loading QuTiP objects............................. 129 3.13.2 Storing and loading datasets................................ 130 3.14 Generating Random Quantum States & Operators......................... 132 3.14.1 Random objects with a given eigen spectrum....................... 134 3.14.2 Composite random objects................................. 135 3.15 Modifying Internal QuTiP Settings................................. 135 3.15.1 User Accessible Parameters................................. 135 3.15.2 Example: Changing Settings................................ 136 3.15.3 Persistent Settings...................................... 136 4 API documentation 137 4.1 Classes................................................ 137 4.1.1 Qobj............................................. 137 4.1.2 eseries............................................ 146 4.1.3 Bloch sphere........................................ 147 4.1.4 Cubic Spline........................................ 149 4.1.5 Non-Markovian Solvers.................................. 150 4.1.6 Solver Options and Results................................. 153 4.1.7 Permutational Invariance.................................. 158 4.1.8 Distribution functions.................................... 161 4.1.9 Quantum information processing.............................. 163 4.1.10 Optimal control....................................... 167 ii 4.2 Functions............................................... 188 4.2.1 Manipulation and Creation of States and Operators.................... 188 4.2.2 Functions acting on states and operators.......................... 212 4.2.3 Dynamics and Time-Evolution............................... 218 4.2.4 Visualization........................................ 246 4.2.5 Quantum Information Processing.............................. 254 4.2.6 non-Markovian Solvers................................... 261 4.2.7 Optimal control....................................... 261 4.2.8 Utility Functions...................................... 275 5 Change Log 283 5.1 Version 4.3.0 (July 14, 2018)..................................... 283 5.1.1 Improvements........................................ 283 5.1.2 Bug Fixes.......................................... 283 5.2 Version 4.2.0 (July 28, 2017)..................................... 284 5.2.1 Improvements........................................ 284 5.2.2 Bug Fixes.......................................... 284 5.3 Version 4.1.0 (March 10, 2017)................................... 284 5.3.1 Improvements........................................ 284 5.3.2 Bug Fixes.......................................... 285 5.4 Version 4.0.2 (January 5, 2017)................................... 285 5.4.1 Bug Fixes.......................................... 285 5.5 Version 4.0.0 (December 22, 2016)................................. 285 5.5.1 Improvements........................................ 285 5.5.2 Bug Fixes.......................................... 285 5.6 Version 3.2.0 (Never officially released)............................... 285 5.6.1 New Features........................................ 285 5.6.2 Improvements........................................ 286 5.6.3 Bug Fixes.......................................... 287 5.7 Version 3.1.0 (January 1, 2015):................................... 288 5.7.1 New Features........................................ 288 5.7.2 Bug Fixes.......................................... 288 5.8 Version 3.0.1 (Aug 5, 2014):..................................... 289 5.8.1 Bug Fixes.......................................... 289 5.9 Version 3.0.0 (July 17, 2014):.................................... 289 5.9.1 New Features........................................ 289 5.9.2 Improvements........................................ 290 5.10 Version 2.2.0 (March 01, 2013):................................... 290 5.10.1 New Features.......................................