diff --git a/doc/apidoc/apidoc.rst b/doc/apidoc/apidoc.rst index bb5f7efd9c..ff2d1f3390 100644 --- a/doc/apidoc/apidoc.rst +++ b/doc/apidoc/apidoc.rst @@ -10,5 +10,11 @@ complete list of QuTiP's public classes and functions. .. toctree:: :maxdepth: 3 - classes.rst - functions.rst + quantumobject.rst + time_dep.rst + solver.rst + heom.rst + piqs.rst + visualization.rst + utilities.rst + experimental.rst diff --git a/doc/apidoc/classes.rst b/doc/apidoc/classes.rst deleted file mode 100644 index 80aee283cd..0000000000 --- a/doc/apidoc/classes.rst +++ /dev/null @@ -1,332 +0,0 @@ -.. _classes: - -*************** -Classes -*************** - -.. _classes-qobj: - -Qobj ----- - -.. autoclass:: qutip.core.qobj.Qobj - :members: - :special-members: __call__ - -.. _classes-qobjevo: - -QobjEvo -------- - -.. autoclass:: qutip.core.cy.qobjevo.QobjEvo - :members: - :special-members: __call__ - -.. _classes-coreoptions: - -CoreOptions ------------ - -.. autoclass:: qutip.core.options.CoreOptions - :members: - - -.. _classes-bloch: - -Bloch sphere ------------- - -.. autoclass:: qutip.bloch.Bloch - :members: - -Distributions -------------- - -.. autoclass:: qutip.QFunc - :members: - -Environments ------------- - -.. autoclass:: qutip.core.BosonicEnvironment - :members: - -.. autoclass:: qutip.core.DrudeLorentzEnvironment - :members: - :inherited-members: - :show-inheritance: - :exclude-members: from_correlation_function, from_power_spectrum, from_spectral_density - -.. autoclass:: qutip.core.UnderDampedEnvironment - :members: - :inherited-members: - :show-inheritance: - :exclude-members: from_correlation_function, from_power_spectrum, from_spectral_density - -.. autoclass:: qutip.core.OhmicEnvironment - :members: - :inherited-members: - :show-inheritance: - :exclude-members: from_correlation_function, from_power_spectrum, from_spectral_density - -.. autoclass:: qutip.core.CFExponent - :members: - -.. autoclass:: qutip.core.ExponentialBosonicEnvironment - :members: - :show-inheritance: - - -.. _classes-solver: - -Solvers -------- - -.. autoclass:: qutip.solver.sesolve.SESolver - :members: - :inherited-members: - :show-inheritance: - :exclude-members: add_integrator - -.. autoclass:: qutip.solver.mesolve.MESolver - :members: - :inherited-members: - :show-inheritance: - :exclude-members: add_integrator - -.. autoclass:: qutip.solver.brmesolve.BRSolver - :members: - :inherited-members: - :show-inheritance: - :exclude-members: add_integrator - -.. autoclass:: qutip.solver.floquet.FMESolver - :members: - :inherited-members: - :show-inheritance: - :exclude-members: add_integrator - -.. autoclass:: qutip.solver.floquet.FloquetBasis - :members: - -.. autoclass:: qutip.solver.propagator.Propagator - :members: - :inherited-members: - :special-members: __call__ - - -.. _classes-monte-carlo-solver: - -Monte Carlo Solvers -------------------- - -.. autoclass:: qutip.solver.mcsolve.MCSolver - :members: - :inherited-members: - :show-inheritance: - :exclude-members: add_integrator - -.. autoclass:: qutip.solver.nm_mcsolve.NonMarkovianMCSolver - :members: - :inherited-members: - :show-inheritance: - :exclude-members: add_integrator - - -.. _classes-non_markov_heom: - -Non-Markovian HEOM Solver -------------------------- - -.. autoclass:: qutip.solver.heom.HEOMSolver - :members: - -.. autoclass:: qutip.solver.heom.HSolverDL - :members: - -.. autoclass:: qutip.solver.heom.BathExponent - :members: - -.. autoclass:: qutip.solver.heom.Bath - :members: - -.. autoclass:: qutip.solver.heom.BosonicBath - :members: - -.. autoclass:: qutip.solver.heom.DrudeLorentzBath - :show-inheritance: - :members: - -.. autoclass:: qutip.solver.heom.DrudeLorentzPadeBath - :show-inheritance: - :members: - -.. autoclass:: qutip.solver.heom.UnderDampedBath - :show-inheritance: - :members: - -.. autoclass:: qutip.solver.heom.FermionicBath - :members: - -.. autoclass:: qutip.solver.heom.LorentzianBath - :show-inheritance: - :members: - -.. autoclass:: qutip.solver.heom.LorentzianPadeBath - :show-inheritance: - :members: - -.. autoclass:: qutip.solver.heom.HierarchyADOs - :members: - -.. autoclass:: qutip.solver.heom.HierarchyADOsState - :members: - -.. autoclass:: qutip.solver.heom.HEOMResult - :members: - - -.. _classes-stochastic: - -Stochastic Solver ------------------ - -.. autoclass:: qutip.solver.stochastic.SMESolver - :members: - :inherited-members: - :exclude-members: add_integrator - -.. autoclass:: qutip.solver.stochastic.SSESolver - :members: - :inherited-members: - :exclude-members: add_integrator - - -.. _classes-ode: - -Integrator ----------- - -.. autoclass:: qutip.solver.integrator.scipy_integrator.IntegratorScipyAdams - :members: options - -.. autoclass:: qutip.solver.integrator.scipy_integrator.IntegratorScipyBDF - :members: options - -.. autoclass:: qutip.solver.integrator.scipy_integrator.IntegratorScipylsoda - :members: options - -.. autoclass:: qutip.solver.integrator.scipy_integrator.IntegratorScipyDop853 - :members: options - -.. autoclass:: qutip.solver.integrator.qutip_integrator.IntegratorVern7 - :members: options - -.. autoclass:: qutip.solver.integrator.qutip_integrator.IntegratorVern9 - :members: options - -.. autoclass:: qutip.solver.integrator.qutip_integrator.IntegratorDiag - :members: options - -.. autoclass:: qutip.solver.integrator.krylov.IntegratorKrylov - :members: options - - -.. _classes-sode: - -Stochastic Integrator ---------------------- - -.. autoclass:: qutip.solver.sode.rouchon.RouchonSODE - :members: options - -.. autoclass:: qutip.solver.sode.itotaylor.EulerSODE - :members: options - -.. autoclass:: qutip.solver.sode.itotaylor.Milstein_SODE - :members: options - -.. autoclass:: qutip.solver.sode.itotaylor.Taylor1_5_SODE - :members: options - -.. autoclass:: qutip.solver.sode.itotaylor.Implicit_Milstein_SODE - :members: options - -.. autoclass:: qutip.solver.sode.itotaylor.Implicit_Taylor1_5_SODE - :members: options - -.. autoclass:: qutip.solver.sode.sode.PlatenSODE - :members: options - -.. autoclass:: qutip.solver.sode.itotaylor.Explicit1_5_SODE - :members: options - -.. autoclass:: qutip.solver.sode.sode.PredCorr_SODE - :members: options - - -.. _classes-odeoptions: - -Solver Options and Results ---------------------------- - -.. autoclass:: qutip.solver.result.Result - :members: - :inherited-members: - :exclude-members: add_processor, add - -.. autoclass:: qutip.solver.multitrajresult.MultiTrajResult - :members: - :inherited-members: - :exclude-members: add_processor, add, add_end_condition - -.. autoclass:: qutip.solver.multitrajresult.McResult - :show-inheritance: - :members: - -.. autoclass:: qutip.solver.multitrajresult.NmmcResult - :show-inheritance: - :members: - -.. _classes-piqs: - -Permutational Invariance ------------------------- - -.. autoclass:: qutip.piqs.piqs.Dicke - :members: - -.. autoclass:: qutip.piqs.piqs.Pim - :members: - -.. _classes-distributions: - -Distribution functions ----------------------- - -.. autoclass:: qutip.distributions.Distribution - :members: - -CompilationOptions ------------------- - -.. autoclass:: qutip.core.coefficient.CompilationOptions - - -.. - Docstrings are empty... - - .. autoclass:: qutip.distributions.WignerDistribution - :members: - - .. autoclass:: qutip.distributions.QDistribution - :members: - - .. autoclass:: qutip.distributions.TwoModeQuadratureCorrelation - :members: - - .. autoclass:: qutip.distributions.HarmonicOscillatorWaveFunction - :members: - - .. autoclass:: qutip.distributions.HarmonicOscillatorProbabilityFunction - :members: diff --git a/doc/apidoc/experimental.rst b/doc/apidoc/experimental.rst new file mode 100644 index 0000000000..06da6244e0 --- /dev/null +++ b/doc/apidoc/experimental.rst @@ -0,0 +1,39 @@ + +************ +Experimental +************ + +.. note:: + + Functions here are untested and under-documented. + +Continuous Variables +-------------------- + +.. automodule:: qutip.continuous_variables + :members: correlation_matrix, covariance_matrix, correlation_matrix_field, correlation_matrix_quadrature, wigner_covariance_matrix, logarithmic_negativity + + +Distribution functions +---------------------- + +.. autoclass:: qutip.distributions.Distribution + :members: + +.. + Docstrings are empty... + + .. autoclass:: qutip.distributions.WignerDistribution + :members: + + .. autoclass:: qutip.distributions.QDistribution + :members: + + .. autoclass:: qutip.distributions.TwoModeQuadratureCorrelation + :members: + + .. autoclass:: qutip.distributions.HarmonicOscillatorWaveFunction + :members: + + .. autoclass:: qutip.distributions.HarmonicOscillatorProbabilityFunction + :members: diff --git a/doc/apidoc/functions.rst b/doc/apidoc/functions.rst deleted file mode 100644 index 153a76e4b4..0000000000 --- a/doc/apidoc/functions.rst +++ /dev/null @@ -1,330 +0,0 @@ -.. _functions: - -*************** -Functions -*************** - -Manipulation and Creation of States and Operators -================================================= - -Quantum States --------------- - -.. automodule:: qutip.core.states - :members: basis, bell_state, bra, coherent, coherent_dm, fock, fock_dm, ghz_state, maximally_mixed_dm, ket, ket2dm, phase_basis, projection, qutrit_basis, singlet_state, spin_state, spin_coherent, state_number_enumerate, state_number_index, state_index_number, state_number_qobj, thermal_dm, triplet_states, w_state, zero_ket - - -Quantum Operators ------------------ - -.. automodule:: qutip.core.operators - :members: charge, commutator, create, destroy, displace, fcreate, fdestroy, jmat, num, qeye, identity, momentum, phase, position, qdiags, qutrit_ops, qzero, sigmam, sigmap, sigmax, sigmay, sigmaz, spin_Jx, spin_Jy, spin_Jz, spin_Jm, spin_Jp, squeeze, squeezing, tunneling, qeye_like, qzero_like - - -Quantum Gates ------------------ - -.. automodule:: qutip.core.gates - :members: rx, ry, rz, sqrtnot, snot, phasegate, qrot, cy_gate, cz_gate, s_gate, t_gate, cs_gate, ct_gate, cphase, cnot, csign, berkeley, swapalpha, swap, iswap, sqrtswap, sqrtiswap, fredkin, molmer_sorensen, toffoli, hadamard_transform, qubit_clifford_group, globalphase - - -Energy Restricted Operators ---------------------------- - -.. automodule:: qutip.core.energy_restricted - :members: enr_state_dictionaries, enr_thermal_dm, enr_fock, enr_destroy, enr_identity - - -.. _functions-rand: - -Quantum Objects ---------------- - -.. automodule:: qutip.core.qobj - :members: ptrace - -.. automodule:: qutip.core.properties - :members: issuper, isoper, isoperket, isoperbra, isket, isbra, isherm - - -Random Operators and States ---------------------------- - -.. automodule:: qutip.random_objects - :members: rand_dm, rand_herm, rand_ket, rand_stochastic, rand_unitary, rand_super, rand_super_bcsz, rand_kraus_map - - -Superoperators and Liouvillians -------------------------------- - -.. automodule:: qutip.core.superoperator - :members: operator_to_vector, vector_to_operator, liouvillian, spost, spre, sprepost, lindblad_dissipator - -Superoperator Representations ------------------------------ - -.. automodule:: qutip.core.superop_reps - :members: kraus_to_choi, kraus_to_super, to_choi, to_chi, to_super, to_kraus, to_stinespring - :undoc-members: - -Operators and Superoperator Dimensions --------------------------------------- - -.. automodule:: qutip.core.dimensions - :members: to_tensor_rep, from_tensor_rep - - -Functions acting on states and operators -======================================== - -Expectation Values ------------------- - -.. automodule:: qutip.core.expect - :members: expect, variance - - -Tensor ------- - -.. automodule:: qutip.core.tensor - :members: tensor, super_tensor, composite, tensor_contract - - - -Partial Transpose ------------------ - -.. automodule:: qutip.partial_transpose - :members: partial_transpose - - -.. _functions-entropy: - -Entropy Functions ------------------ - -.. automodule:: qutip.entropy - :members: concurrence, entropy_conditional, entropy_linear, entropy_mutual, entropy_relative, entropy_vn - - -Density Matrix Metrics ----------------------- - -.. automodule:: qutip.core.metrics - :members: fidelity, tracedist, bures_dist, bures_angle, hellinger_dist, hilbert_dist, average_gate_fidelity, process_fidelity, unitarity, dnorm - - -Continuous Variables --------------------- - -.. automodule:: qutip.continuous_variables - :members: correlation_matrix, covariance_matrix, correlation_matrix_field, correlation_matrix_quadrature, wigner_covariance_matrix, logarithmic_negativity - - -Measurement -=========== - -Measurement of quantum states ------------------------------ - -.. automodule:: qutip.measurement - :members: measure, measure_povm, measure_observable, measurement_statistics, measurement_statistics_observable, measurement_statistics_povm - - -Dynamics and Time-Evolution -=========================== - -Schrödinger Equation --------------------- - -.. automodule:: qutip.solver.sesolve - :members: sesolve - -Master Equation ---------------- - -.. automodule:: qutip.solver.mesolve - :members: mesolve - -Monte Carlo Evolution ---------------------- - -.. automodule:: qutip.solver.mcsolve - :members: mcsolve - -.. automodule:: qutip.solver.nm_mcsolve - :members: nm_mcsolve - - -Krylov Subspace Solver ----------------------- - -.. automodule:: qutip.solver.krylovsolve - :members: krylovsolve - - -Bloch-Redfield Master Equation ------------------------------- - -.. automodule:: qutip.solver.brmesolve - :members: brmesolve - - -Floquet States and Floquet-Markov Master Equation -------------------------------------------------- - -.. automodule:: qutip.solver.floquet - :members: fmmesolve, fsesolve, floquet_tensor - - -Stochastic Schrödinger Equation and Master Equation ---------------------------------------------------- - -.. automodule:: qutip.solver.stochastic - :members: ssesolve, smesolve - - -Constructing time dependent systems ------------------------------------ - -.. automodule:: qutip.core.coefficient - :members: coefficient - - -Hierarchical Equations of Motion --------------------------------- - -.. automodule:: qutip.solver.heom - :members: heomsolve - - -Correlation Functions ---------------------- - -.. automodule:: qutip.solver.correlation - :members: correlation_2op_1t, correlation_2op_2t, correlation_3op_1t, correlation_3op_2t, correlation_3op, coherence_function_g1, coherence_function_g2 - -.. automodule:: qutip.solver.spectrum - :members: spectrum, spectrum_correlation_fft - -.. automodule:: qutip.core.environment - :members: system_terminator - - -Steady-state Solvers --------------------- - -.. automodule:: qutip.solver.steadystate - :members: steadystate, pseudo_inverse, steadystate_floquet - :undoc-members: - -Propagators ------------ - -.. automodule:: qutip.solver.propagator - :members: propagator, propagator_steadystate - :undoc-members: - -Scattering in Quantum Optical Systems -------------------------------------- - -.. automodule:: qutip.solver.scattering - :members: temporal_basis_vector, temporal_scattered_state, scattering_probability - :undoc-members: - -Permutational Invariance ------------------------- - -.. automodule:: qutip.piqs.piqs - :members: num_dicke_states, num_dicke_ladders, num_tls, isdiagonal, dicke_blocks, dicke_blocks_full, dicke_function_trace, purity_dicke, entropy_vn_dicke, state_degeneracy, m_degeneracy, energy_degeneracy, ap, am, spin_algebra, jspin, collapse_uncoupled, dicke_basis, dicke, excited, superradiant, css, ghz, ground, identity_uncoupled, block_matrix, tau_column, - - -Visualization -=============== - -Pseudoprobability Functions ---------------------------- - -.. automodule:: qutip.wigner - :members: qfunc, spin_q_function, spin_wigner, wigner - - -Graphs and Visualization ------------------------- - -.. automodule:: qutip.visualization - :members: hinton, matrix_histogram, plot_energy_levels, plot_fock_distribution, plot_wigner, sphereplot, plot_schmidt, plot_qubism, plot_expectation_values, plot_wigner_sphere, plot_spin_distribution - :undoc-members: - -.. automodule:: qutip.animation - :members: anim_hinton, anim_matrix_histogram, anim_fock_distribution, anim_wigner, anim_sphereplot, anim_schmidt, anim_qubism, anim_wigner_sphere, anim_spin_distribution - - -.. automodule:: qutip.matplotlib_utilities - :members: wigner_cmap, complex_phase_cmap - - -Quantum Process Tomography --------------------------- - -.. automodule:: qutip.tomography - :members: qpt, qpt_plot, qpt_plot_combined - :undoc-members: - - -.. _functions-non_markov: - -Non-Markovian Solvers -===================== - -.. automodule:: qutip.solver.nonmarkov.transfertensor - :members: ttmsolve - - -Utility Functions -================= - - -.. _functions-utilities: - -Utility Functions ------------------ - -.. automodule:: qutip.utilities - :members: n_thermal, clebsch, convert_unit, iterated_fit - - -.. _functions-fileio: - -File I/O Functions ------------------- - -.. automodule:: qutip.fileio - :members: file_data_read, file_data_store, qload, qsave - - -.. _functions-parallel: - -Parallelization ---------------- - -.. automodule:: qutip.solver.parallel - :members: parallel_map, serial_map, loky_pmap, mpi_pmap - - -.. _functions-ipython: - -IPython Notebook Tools ----------------------- - -.. automodule:: qutip.ipynbtools - :members: version_table - -.. _functions-misc: - -Miscellaneous -------------- - -.. automodule:: qutip - :members: about, simdiag diff --git a/doc/apidoc/heom.rst b/doc/apidoc/heom.rst new file mode 100644 index 0000000000..3af9f58854 --- /dev/null +++ b/doc/apidoc/heom.rst @@ -0,0 +1,93 @@ +************ +Environments +************ + +Bosonic Environments +-------------------- + +.. autoclass:: qutip.core.BosonicEnvironment + :members: + +.. autoclass:: qutip.core.DrudeLorentzEnvironment + :members: + :inherited-members: + :show-inheritance: + :exclude-members: from_correlation_function, from_power_spectrum, from_spectral_density + +.. autoclass:: qutip.core.UnderDampedEnvironment + :members: + :inherited-members: + :show-inheritance: + :exclude-members: from_correlation_function, from_power_spectrum, from_spectral_density + +.. autoclass:: qutip.core.OhmicEnvironment + :members: + :inherited-members: + :show-inheritance: + :exclude-members: from_correlation_function, from_power_spectrum, from_spectral_density + +.. autoclass:: qutip.core.CFExponent + :members: + +.. autoclass:: qutip.core.ExponentialBosonicEnvironment + :members: + :show-inheritance: + +.. autofunction:: qutip.core.environment.system_terminator + + + +******************************** +Hierarchical Equations of Motion +******************************** + +HEOM Solvers +------------ + +.. automodule:: qutip.solver.heom + :members: heomsolve + +.. autoclass:: qutip.solver.heom.HEOMSolver + :members: + +.. autoclass:: qutip.solver.heom.HSolverDL + :members: + +.. autoclass:: qutip.solver.heom.HierarchyADOs + :members: + +.. autoclass:: qutip.solver.heom.HierarchyADOsState + :members: + +.. autoclass:: qutip.solver.heom.HEOMResult + :members: + +Baths +----- + +.. autoclass:: qutip.solver.heom.BathExponent + :members: + +.. autoclass:: qutip.solver.heom.Bath + :members: + +.. autoclass:: qutip.solver.heom.BosonicBath + :members: + +.. autoclass:: qutip.solver.heom.DrudeLorentzBath + :members: + +.. autoclass:: qutip.solver.heom.DrudeLorentzPadeBath + :members: + +.. autoclass:: qutip.solver.heom.UnderDampedBath + :members: + +.. autoclass:: qutip.solver.heom.FermionicBath + :members: + +.. autoclass:: qutip.solver.heom.LorentzianBath + :members: + +.. autoclass:: qutip.solver.heom.LorentzianPadeBath + :members: diff --git a/doc/apidoc/piqs.rst b/doc/apidoc/piqs.rst new file mode 100644 index 0000000000..f90eb9b343 --- /dev/null +++ b/doc/apidoc/piqs.rst @@ -0,0 +1,12 @@ +************************ +Permutational Invariance +************************ + +.. autoclass:: qutip.piqs.piqs.Dicke + :members: + +.. autoclass:: qutip.piqs.piqs.Pim + :members: + +.. automodule:: qutip.piqs.piqs + :members: num_dicke_states, num_dicke_ladders, num_tls, isdiagonal, dicke_blocks, dicke_blocks_full, dicke_function_trace, purity_dicke, entropy_vn_dicke, state_degeneracy, m_degeneracy, energy_degeneracy, ap, am, spin_algebra, jspin, collapse_uncoupled, dicke_basis, dicke, excited, superradiant, css, ghz, ground, identity_uncoupled, block_matrix, tau_column, diff --git a/doc/apidoc/quantumobject.rst b/doc/apidoc/quantumobject.rst new file mode 100644 index 0000000000..12983f36d9 --- /dev/null +++ b/doc/apidoc/quantumobject.rst @@ -0,0 +1,134 @@ +.. _api_qobj: + +*************** +Quantum Objects +*************** + +.. _classes-qobj: + +Qobj +---- + +.. autoclass:: qutip.core.qobj.Qobj + :members: + :special-members: __call__ + +.. automodule:: qutip.core.properties + :members: issuper, isoper, isoperket, isoperbra, isket, isbra, isherm + +CoreOptions +----------- + +.. autoclass:: qutip.core.options.CoreOptions + :members: + +******************************** +Creation of States and Operators +******************************** + +Quantum States +-------------- + +.. automodule:: qutip.core.states + :members: basis, bell_state, bra, coherent, coherent_dm, fock, fock_dm, ghz_state, maximally_mixed_dm, ket, ket2dm, phase_basis, projection, qutrit_basis, singlet_state, spin_state, spin_coherent, state_number_enumerate, state_number_index, state_index_number, state_number_qobj, thermal_dm, triplet_states, w_state, zero_ket + + +Quantum Operators +----------------- + +.. automodule:: qutip.core.operators + :members: charge, commutator, create, destroy, displace, fcreate, fdestroy, jmat, num, qeye, identity, momentum, phase, position, qdiags, qutrit_ops, qzero, sigmam, sigmap, sigmax, sigmay, sigmaz, spin_Jx, spin_Jy, spin_Jz, spin_Jm, spin_Jp, squeeze, squeezing, tunneling, qeye_like, qzero_like + + +Quantum Gates +------------- + +.. automodule:: qutip.core.gates + :members: rx, ry, rz, sqrtnot, snot, phasegate, qrot, cy_gate, cz_gate, s_gate, t_gate, cs_gate, ct_gate, cphase, cnot, csign, berkeley, swapalpha, swap, iswap, sqrtswap, sqrtiswap, fredkin, molmer_sorensen, toffoli, hadamard_transform, qubit_clifford_group, globalphase + + +Energy Restricted Operators +--------------------------- + +.. automodule:: qutip.core.energy_restricted + :members: enr_state_dictionaries, enr_thermal_dm, enr_fock, enr_destroy, enr_identity + + +.. _api-rand: + +Random Operators and States +--------------------------- + +.. automodule:: qutip.random_objects + :members: rand_dm, rand_herm, rand_ket, rand_stochastic, rand_unitary, rand_super, rand_super_bcsz, rand_kraus_map + + +******************** +Manipulation of Qobj +******************** + +Tensor +------ + +.. automodule:: qutip.core.tensor + :members: tensor, super_tensor, composite, tensor_contract + +.. automodule:: qutip.core.qobj + :members: ptrace + +.. automodule:: qutip.partial_transpose + :members: partial_transpose + +Superoperators and Liouvillians +------------------------------- + +.. automodule:: qutip.core.superoperator + :members: operator_to_vector, vector_to_operator, liouvillian, spost, spre, sprepost, lindblad_dissipator + +Superoperator Representations +----------------------------- + +.. automodule:: qutip.core.superop_reps + :members: kraus_to_choi, kraus_to_super, to_choi, to_chi, to_super, to_kraus, to_stinespring + :undoc-members: + +Operators and Superoperator Dimensions +-------------------------------------- + +.. automodule:: qutip.core.dimensions + :members: to_tensor_rep, from_tensor_rep + +Miscellaneous +------------- + +.. automodule:: qutip.simdiag + :members: simdiag + + +************************* +Extracting data from Qobj +************************* + +Expectation Values +------------------ + +.. automodule:: qutip.core.expect + :members: expect, variance + +Entropy Functions +----------------- + +.. automodule:: qutip.entropy + :members: concurrence, entropy_conditional, entropy_linear, entropy_mutual, entropy_relative, entropy_vn + +Density Matrix Metrics +---------------------- + +.. automodule:: qutip.core.metrics + :members: fidelity, tracedist, bures_dist, bures_angle, hellinger_dist, hilbert_dist, average_gate_fidelity, process_fidelity, unitarity, dnorm + +Measurement of quantum states +----------------------------- + +.. automodule:: qutip.measurement + :members: measure, measure_povm, measure_observable, measurement_statistics, measurement_statistics_observable, measurement_statistics_povm diff --git a/doc/apidoc/solver.rst b/doc/apidoc/solver.rst new file mode 100644 index 0000000000..cf645fd30f --- /dev/null +++ b/doc/apidoc/solver.rst @@ -0,0 +1,235 @@ +*************************** +Dynamics and Time-Evolution +*************************** + +Schrödinger Equation +-------------------- + +.. automodule:: qutip.solver.sesolve + :members: sesolve + +.. automodule:: qutip.solver.krylovsolve + :members: krylovsolve + +.. autoclass:: qutip.solver.sesolve.SESolver + :members: + :inherited-members: + :show-inheritance: + :exclude-members: add_integrator + +Master Equation +--------------- + +.. automodule:: qutip.solver.mesolve + :members: mesolve + +.. autoclass:: qutip.solver.mesolve.MESolver + :members: + :inherited-members: + :show-inheritance: + :exclude-members: add_integrator + +.. autoclass:: qutip.solver.result.Result + :members: + :inherited-members: + :exclude-members: add_processor, add + +Monte Carlo Evolution +--------------------- + +.. automodule:: qutip.solver.mcsolve + :members: mcsolve + +.. autoclass:: qutip.solver.mcsolve.MCSolver + :members: + :inherited-members: + :show-inheritance: + :exclude-members: add_integrator + +.. automodule:: qutip.solver.nm_mcsolve + :members: nm_mcsolve + +.. autoclass:: qutip.solver.nm_mcsolve.NonMarkovianMCSolver + :members: + :inherited-members: + :show-inheritance: + :exclude-members: add_integrator + +.. autoclass:: qutip.solver.multitrajresult.McResult + :show-inheritance: + :members: + +.. autoclass:: qutip.solver.multitrajresult.NmmcResult + :show-inheritance: + :members: + + +Bloch-Redfield Master Equation +------------------------------ + +.. automodule:: qutip.solver.brmesolve + :members: brmesolve + +.. autoclass:: qutip.solver.brmesolve.BRSolver + :members: + :inherited-members: + :show-inheritance: + :exclude-members: add_integrator + +Floquet States and Floquet-Markov Master Equation +------------------------------------------------- + +.. automodule:: qutip.solver.floquet + :members: fmmesolve, fsesolve, floquet_tensor + +.. autoclass:: qutip.solver.floquet.FMESolver + :members: + :inherited-members: + :show-inheritance: + :exclude-members: add_integrator + +.. autoclass:: qutip.solver.floquet.FloquetBasis + :members: + +Stochastic Schrödinger Equation and Master Equation +--------------------------------------------------- + +.. automodule:: qutip.solver.stochastic + :members: ssesolve, smesolve + +.. autoclass:: qutip.solver.stochastic.SMESolver + :members: + :inherited-members: + :exclude-members: add_integrator + +.. autoclass:: qutip.solver.stochastic.SSESolver + :members: + :inherited-members: + :exclude-members: add_integrator + +.. autoclass:: qutip.solver.multitrajresult.MultiTrajResult + :members: + :inherited-members: + :exclude-members: add_processor, add, add_end_condition + +Non-Markovian Solvers +--------------------- + +.. automodule:: qutip.solver.nonmarkov.transfertensor + :members: ttmsolve + + +.. _api-ode: + +Integrator +---------- +Different ODE solver from many sources (scipy, diffrax, home made, etc.) used +by qutip solvers. Their options are added to the solver options: + +.. autoclass:: qutip.solver.integrator.scipy_integrator.IntegratorScipyAdams + :members: options + +.. autoclass:: qutip.solver.integrator.scipy_integrator.IntegratorScipyBDF + :members: options + +.. autoclass:: qutip.solver.integrator.scipy_integrator.IntegratorScipylsoda + :members: options + +.. autoclass:: qutip.solver.integrator.scipy_integrator.IntegratorScipyDop853 + :members: options + +.. autoclass:: qutip.solver.integrator.qutip_integrator.IntegratorVern7 + :members: options + +.. autoclass:: qutip.solver.integrator.qutip_integrator.IntegratorVern9 + :members: options + +.. autoclass:: qutip.solver.integrator.qutip_integrator.IntegratorDiag + :members: options + +.. autoclass:: qutip.solver.integrator.krylov.IntegratorKrylov + :members: options + + +.. _classes-sode: + +Stochastic Integrator +--------------------- + +.. autoclass:: qutip.solver.sode.rouchon.RouchonSODE + :members: options + +.. autoclass:: qutip.solver.sode.itotaylor.EulerSODE + :members: options + +.. autoclass:: qutip.solver.sode.itotaylor.Milstein_SODE + :members: options + +.. autoclass:: qutip.solver.sode.itotaylor.Taylor1_5_SODE + :members: options + +.. autoclass:: qutip.solver.sode.itotaylor.Implicit_Milstein_SODE + :members: options + +.. autoclass:: qutip.solver.sode.itotaylor.Implicit_Taylor1_5_SODE + :members: options + +.. autoclass:: qutip.solver.sode.sode.PlatenSODE + :members: options + +.. autoclass:: qutip.solver.sode.itotaylor.Explicit1_5_SODE + :members: options + +.. autoclass:: qutip.solver.sode.sode.PredCorr_SODE + :members: options + +Parallelization +--------------- + +.. automodule:: qutip.solver.parallel + :members: parallel_map, serial_map, loky_pmap, mpi_pmap + + +*********** +Propagators +*********** + +.. automodule:: qutip.solver.propagator + :members: propagator, propagator_steadystate + :undoc-members: + +.. autoclass:: qutip.solver.propagator.Propagator + :members: + :inherited-members: + :special-members: __call__ + + +************************ +Other dynamics functions +************************ + + +Correlation Functions +--------------------- + +.. automodule:: qutip.solver.correlation + :members: correlation_2op_1t, correlation_2op_2t, correlation_3op_1t, correlation_3op_2t, correlation_3op, coherence_function_g1, coherence_function_g2 + +.. automodule:: qutip.solver.spectrum + :members: spectrum, spectrum_correlation_fft + + +Steady-state Solvers +-------------------- + +.. automodule:: qutip.solver.steadystate + :members: steadystate, pseudo_inverse, steadystate_floquet + :undoc-members: + + +Scattering in Quantum Optical Systems +------------------------------------- + +.. automodule:: qutip.solver.scattering + :members: temporal_basis_vector, temporal_scattered_state, scattering_probability + :undoc-members: diff --git a/doc/apidoc/time_dep.rst b/doc/apidoc/time_dep.rst new file mode 100644 index 0000000000..890195d6ec --- /dev/null +++ b/doc/apidoc/time_dep.rst @@ -0,0 +1,22 @@ +*********************************** +Constructing time dependent systems +*********************************** + +QobjEvo +------- + +.. autoclass:: qutip.core.cy.qobjevo.QobjEvo + :members: + :special-members: __call__ + +Coefficient +----------- + +.. automodule:: qutip.core.coefficient + :members: coefficient + + +CompilationOptions +------------------ + +.. autoclass:: qutip.core.coefficient.CompilationOptions diff --git a/doc/apidoc/utilities.rst b/doc/apidoc/utilities.rst new file mode 100644 index 0000000000..98def612c4 --- /dev/null +++ b/doc/apidoc/utilities.rst @@ -0,0 +1,36 @@ +Utility Functions +================= + +.. _utilities: + +Utility Functions +----------------- + +.. automodule:: qutip.utilities + :members: n_thermal, clebsch, convert_unit, iterated_fit + + +.. _fileio: + +File I/O Functions +------------------ + +.. automodule:: qutip.fileio + :members: file_data_read, file_data_store, qload, qsave + + +.. _ipython: + +IPython Notebook Tools +---------------------- + +.. automodule:: qutip.ipynbtools + :members: version_table + +.. _misc: + +Miscellaneous +------------- + +.. automodule:: qutip.about + :members: about diff --git a/doc/apidoc/visualization.rst b/doc/apidoc/visualization.rst new file mode 100644 index 0000000000..1305886c49 --- /dev/null +++ b/doc/apidoc/visualization.rst @@ -0,0 +1,39 @@ +*************************** +Visualization and animation +*************************** + +Bloch sphere +------------ + +.. autoclass:: qutip.bloch.Bloch + :members: + +Graphs and Visualization +------------------------ + +.. automodule:: qutip.visualization + :members: hinton, matrix_histogram, plot_energy_levels, plot_fock_distribution, plot_wigner, sphereplot, plot_schmidt, plot_qubism, plot_expectation_values, plot_wigner_sphere, plot_spin_distribution + :undoc-members: + +.. automodule:: qutip.animation + :members: anim_hinton, anim_matrix_histogram, anim_fock_distribution, anim_wigner, anim_sphereplot, anim_schmidt, anim_qubism, anim_wigner_sphere, anim_spin_distribution + +.. automodule:: qutip.matplotlib_utilities + :members: wigner_cmap, complex_phase_cmap + + +Pseudoprobability Functions +--------------------------- + +.. automodule:: qutip.wigner + :members: qfunc, spin_q_function, spin_wigner, wigner + +.. autoclass:: qutip.QFunc + :members: + +Quantum Process Tomography +-------------------------- + +.. automodule:: qutip.tomography + :members: qpt, qpt_plot, qpt_plot_combined + :undoc-members: diff --git a/doc/changes/2532.bugfix b/doc/changes/2532.bugfix new file mode 100644 index 0000000000..3486819866 --- /dev/null +++ b/doc/changes/2532.bugfix @@ -0,0 +1 @@ +`propagator` now accepts list format `c_ops` like `mesolve` does. diff --git a/doc/changes/2538.misc b/doc/changes/2538.misc new file mode 100644 index 0000000000..834eec6857 --- /dev/null +++ b/doc/changes/2538.misc @@ -0,0 +1 @@ +Allow tests to be executed multiple times in one Python session diff --git a/doc/guide/dynamics/dynamics-options.rst b/doc/guide/dynamics/dynamics-options.rst index 5531450d09..2d57f620e1 100644 --- a/doc/guide/dynamics/dynamics-options.rst +++ b/doc/guide/dynamics/dynamics-options.rst @@ -31,7 +31,7 @@ they can be listed through the integrator method of the solvers: help(MESolver.integrator("adams").options) -See :ref:`classes-ode` for a list of supported methods. +See :ref:`api-ode` for a list of supported methods. As an example, let us consider changing the integrator, turn the GUI off, and @@ -41,7 +41,7 @@ strengthen the absolute tolerance. options = {method="bdf", "atol": 1e-10, "progress_bar": False} -To use these new settings we can use the keyword argument ``options`` in either +To use these new settings we can use the keyword argument ``options`` in either the :func:`.mesolve` and :func:`.mcsolve` function:: >>> mesolve(H0, psi0, tlist, c_op_list, [sigmaz()], options=options) diff --git a/doc/guide/guide-basics.rst b/doc/guide/guide-basics.rst index ef00ff37ac..55c0390358 100644 --- a/doc/guide/guide-basics.rst +++ b/doc/guide/guide-basics.rst @@ -25,7 +25,7 @@ This will load all of the user available functions. Often, we also need to impor import matplotlib.pyplot as plt -In the rest of the documentation, functions are written using `qutip.module.function()` notation which links to the corresponding function in the QuTiP API: :ref:`functions`. However, in calling `import *`, we have already loaded all of the QuTiP modules. Therefore, we will only need the function name and not the complete path when calling the function from the interpreter prompt, Python script, or Jupyter notebook. +In the rest of the documentation, functions are written using `qutip.module.function()` notation which links to the corresponding function in the QuTiP API: :ref:`apidoc`. However, in calling `import *`, we have already loaded all of the QuTiP modules. Therefore, we will only need the function name and not the complete path when calling the function from the interpreter prompt, Python script, or Jupyter notebook. .. _basics-qobj: diff --git a/doc/guide/guide-random.rst b/doc/guide/guide-random.rst index 86d0abc1cd..e111dd9992 100644 --- a/doc/guide/guide-random.rst +++ b/doc/guide/guide-random.rst @@ -105,7 +105,7 @@ For example, [ 0.016-0.045j, -0.057+0.078j, -0.028+0.058j, 0.101+0.056j, 0.236+0.j ]] -See the API documentation: :ref:`functions-rand` for details. +See the API documentation: :ref:`api-rand` for details. .. warning:: diff --git a/qutip/core/environment.py b/qutip/core/environment.py index 5284e4fabe..a9c1a749b3 100644 --- a/qutip/core/environment.py +++ b/qutip/core/environment.py @@ -899,7 +899,7 @@ def approx_by_matsubara( dirac(t)``, where ``dirac(t)`` denotes the Dirac delta function. It can be used to create a "terminator" term to add to the system dynamics to take this discrepancy into account, see - :func:`system_terminator`. + :func:`.system_terminator`. """ if tag is None and self.tag is not None: tag = (self.tag, "Matsubara Truncation") @@ -948,7 +948,7 @@ def approx_by_pade( dirac(t)``, where ``dirac(t)`` denotes the Dirac delta function. It can be used to create a "terminator" term to add to the system dynamics to take this discrepancy into account, see - :func:`system_terminator`. + :func:`.system_terminator`. """ if tag is None and self.tag is not None: tag = (self.tag, "Pade Truncation") @@ -1733,7 +1733,7 @@ def system_terminator(Q: Qobj, delta: float) -> Qobj: delta : float The approximation discrepancy of approximating an environment with a finite number of exponentials, see for example - :meth:`DrudeLorentzEnvironment.approx_by_matsubara`. + :meth:`.DrudeLorentzEnvironment.approx_by_matsubara`. Returns ------- diff --git a/qutip/core/options.py b/qutip/core/options.py index 50c97e8e13..d055c910e9 100644 --- a/qutip/core/options.py +++ b/qutip/core/options.py @@ -104,11 +104,11 @@ class CoreOptions(QutipOptions): ``basis([2, 2]).dims == [[2, 2], [1]]`` atol : float {1e-12} - General absolute tolerance + General absolute tolerance. Used in various functions to round off + small values. rtol : float {1e-12} - General relative tolerance - Used to choose QobjEvo.expect output type + General relative tolerance. auto_tidyup_atol : float {1e-14} The absolute tolerance used in automatic tidyup (see the diff --git a/qutip/solver/propagator.py b/qutip/solver/propagator.py index 2abef1680d..f42dd279fd 100644 --- a/qutip/solver/propagator.py +++ b/qutip/solver/propagator.py @@ -48,7 +48,8 @@ def propagator( will always be the identity matrix. c_ops : list, optional - List of Qobj or QobjEvo collapse operators. + List of collapse operators as Qobj, QobjEvo or list that can be made + into QobjEvo. args : dictionary, optional Parameters to callback functions for time-dependent Hamiltonians and @@ -59,7 +60,9 @@ def propagator( **kwargs : Extra parameters to use when creating the - :obj:`.QobjEvo` from a list format ``H``. + :obj:`.QobjEvo` from a list format ``H``. The most common are ``tlist`` + and ``order`` for array-based time dependance. See :obj:`.QobjEvo` for + the full list. Returns ------- @@ -67,6 +70,13 @@ def propagator( Instance representing the propagator(s) :math:`U(t)`. Return a single Qobj when ``t`` is a number or a list when ``t`` is a list. + Notes + ----- + Unlike :func:`.sesolve` or :func:`.mesolve`, the output times in ``t`` are + not used for array time dependent system. ``tlist`` must be passed as a + keyword argument in those case. ``tlist`` and ``t`` can have different + length and values. + """ if isinstance(t, numbers.Real): tlist = [0, t] @@ -78,6 +88,9 @@ def propagator( if not isinstance(H, (Qobj, QobjEvo)): H = QobjEvo(H, args=args, **kwargs) + if isinstance(c_ops, list): + c_ops = [QobjEvo(op, args=args, **kwargs) for op in c_ops] + if c_ops: H = liouvillian(H, c_ops) diff --git a/qutip/tests/core/data/test_convert.py b/qutip/tests/core/data/test_convert.py index 0cbb7aaf9c..bbfb8f67ac 100644 --- a/qutip/tests/core/data/test_convert.py +++ b/qutip/tests/core/data/test_convert.py @@ -66,7 +66,8 @@ def test_converters(from_, base, to_, dtype): dtype_names = list(data.to._str2type.keys()) + list(data.to.dtypes) dtype_types = list(data.to._str2type.values()) + list(data.to.dtypes) -@pytest.mark.parametrize(['input', 'type_'], zip(dtype_names, dtype_types), +dtype_combinations = list(zip(dtype_names, dtype_types)) +@pytest.mark.parametrize(['input', 'type_'], dtype_combinations, ids=[str(dtype) for dtype in dtype_names]) def test_parse(input, type_): assert data.to.parse(input) is type_ diff --git a/qutip/tests/core/test_states.py b/qutip/tests/core/test_states.py index 6168ddb76c..f67d06d5d8 100644 --- a/qutip/tests/core/test_states.py +++ b/qutip/tests/core/test_states.py @@ -273,7 +273,8 @@ def _id_func(val): # Obtain all valid dtype from `to` dtype_names = list(qutip.data.to._str2type.keys()) + list(qutip.data.to.dtypes) dtype_types = list(qutip.data.to._str2type.values()) + list(qutip.data.to.dtypes) -@pytest.mark.parametrize(['alias', 'dtype'], zip(dtype_names, dtype_types), +dtype_combinations = list(zip(dtype_names, dtype_types)) +@pytest.mark.parametrize(['alias', 'dtype'], dtype_combinations, ids=[str(dtype) for dtype in dtype_names]) @pytest.mark.parametrize(['func', 'args'], [ (qutip.basis, (5, 1)), @@ -327,4 +328,4 @@ def test_state_type(func, args, alias, dtype): ], ids=_id_func) def test_state_space_input(func, args): dims = qutip.dimensions.Space([2, 2, 2]) - assert func(dims, *args) == func([2, 2, 2], *args) \ No newline at end of file + assert func(dims, *args) == func([2, 2, 2], *args) diff --git a/qutip/tests/solver/test_propagator.py b/qutip/tests/solver/test_propagator.py index ffb335cbe3..0db507c2df 100644 --- a/qutip/tests/solver/test_propagator.py +++ b/qutip/tests/solver/test_propagator.py @@ -2,11 +2,11 @@ from scipy.integrate import trapezoid from qutip import (destroy, propagator, Propagator, propagator_steadystate, steadystate, tensor, qeye, basis, QobjEvo, sesolve, - liouvillian) + liouvillian, rand_dm) import qutip import pytest from qutip.solver.brmesolve import BRSolver -from qutip.solver.mesolve import MESolver +from qutip.solver.mesolve import MESolver, mesolve from qutip.solver.sesolve import SESolver from qutip.solver.mcsolve import MCSolver @@ -49,6 +49,20 @@ def testPropHOTd(): assert (U - U2).norm('max') < 1e-4 +def testPropHOTd(): + "Propagator: func array td format + open" + a = destroy(5) + H = a.dag()*a + ts = np.linspace(-0.01, 1.01, 103) + coeffs = np.cos(ts) + Htd = [H, [H, coeffs]] + rho_0 = rand_dm(5) + rho_1_prop = propagator(Htd, 1, c_ops=[a], tlist=ts)(rho_0) + rho_1_me = mesolve(QobjEvo(Htd, tlist=ts), rho_0, [0, 1], [a]).final_state + + assert (rho_1_prop - rho_1_me).norm('max') < 1e-4 + + def testPropObjTd(): a = destroy(5) H = a.dag()*a diff --git a/qutip/tests/test_random.py b/qutip/tests/test_random.py index d5a860d79d..8cc4babf17 100644 --- a/qutip/tests/test_random.py +++ b/qutip/tests/test_random.py @@ -310,7 +310,8 @@ def test_kraus_map(dimensions, dtype): dtype_names = list(_data.to._str2type.keys()) + list(_data.to.dtypes) dtype_types = list(_data.to._str2type.values()) + list(_data.to.dtypes) -@pytest.mark.parametrize(['alias', 'dtype'], zip(dtype_names, dtype_types), +dtype_combinations = list(zip(dtype_names, dtype_types)) +@pytest.mark.parametrize(['alias', 'dtype'], dtype_combinations, ids=[str(dtype) for dtype in dtype_names]) @pytest.mark.parametrize('func', [ rand_herm, diff --git a/qutip/utilities.py b/qutip/utilities.py index ba143f0765..e759aaaa54 100644 --- a/qutip/utilities.py +++ b/qutip/utilities.py @@ -3,6 +3,9 @@ qutip modules. """ +# Required for Sphinx to follow autodoc_type_aliases +from __future__ import annotations + __all__ = ['n_thermal', 'clebsch', 'convert_unit', 'iterated_fit'] from typing import Callable @@ -360,7 +363,7 @@ def iterated_fit( y = \sum_{k=1}^N f(x; p_{k,1}, \dots, p_{k,n}) where `f` is a model function depending on `n` parameters, and the number - `N` of terms is increases until the normalized rmse (root mean square + `N` of terms is increased until the normalized rmse (root mean square error) falls below the target value. Parameters