QuTiP 5 is a redesign of many of the core components of QuTiP (Qobj
,QobjEvo
, solvers) to make them more consistent and more flexible.
Qobj
may now be stored in either sparse or dense representations,
and the two may be mixed sensibly as needed. QobjEvo
is now used
consistently throughout QuTiP, and the implementation has been
substantially cleaned up. A new Coefficient
class is used to
represent the time-dependent factors inside QobjEvo
.
The solvers have been rewritten to work well with the new data layer
and the concept of Integrators
which solve ODEs has been introduced.
In future, new data layers may provide their own Integrators
specialized to their representation of the underlying data.
Much of the user-facing API of QuTiP remains familiar, but there have
had to be many small breaking changes. If we can make changes to
easy migrating code from QuTiP 4 to QuTiP 5, please let us know.
A notebook to help with migration is available on colab.
An extensive list of changes follows.
ContributorsQuTiP 5 has been a large effort by many people over the last three years.
In particular:
qutip_qip
.Other members of the QuTiP Admin team have been heavily involved in reviewing,
testing and designing QuTiP 5:
Two Google Summer of Code contributors updated the tutorials and benchmarks to
QuTiP 5:
During an internship at RIKEN, Patrick Hopf created a new quantum control method and
improved the existing methods interface:
Four experimental data layers backends were written either as part of Google Summer
of Code or as separate projects. While these are still alpha quality, they helped
significantly to test the data layer API:
qutip-tensorflow
: a TensorFlow backend by Asier Galicia (https://github.com/qutip/qutip-tensorflow)qutip-cupy
: a CuPy GPU backend by Felipe Bivort Haiek (https://github.com/qutip/qutip-cupy/)qutip-tensornetwork
: a TensorNetwork backend by Asier Galicia (https://github.com/qutip/qutip-tensornetwork)qutip-jax
: a JAX backend by Eric Giguère (https://github.com/qutip/qutip-jax/)Finally, Yuji Tamakoshi updated the visualization function and added animation
functions as part of Google Summer of Code project.
We have also had many other contributors, whose specific contributions are
detailed below:
bloch_redfield_tensor
function to accept strings and callables for a_ops
, #1951)qutip_qip
to be imported as qutip.qip
, #1920)process_fidelity
and average_gate_fidelity
, #1712, #1748 , #1788)qutip.Bloch
, #1335)kraus_to_choi
making it faster, #2284)expect
documentation, #2331)Previously Qobj
data was stored in a SciPy-like sparse matrix. Now the
representation is flexible. Implementations for dense and sparse formats are
included in QuTiP and custom implementations are possible. QuTiP's performance
on dense states and operators is significantly improved as a result.
Some highlights:
.data
attribute, but is now anqutip.core.data
may be used on .data
,Qobj
with different data types may be mixed in arithmetic and other.to(...)
method may be used to convert a Qobj
from one data type.to("dense")
will convert to the dense representation and.to("csr")
will convert to the sparse type.Qobj
methods and methods that create Qobj
now accepted a dtype
Qobj
to specified.&
operator may be used to obtain the tensor product.@
operator may be used to obtain the matrix / operator product.bar @ ket
returns a scalar..contract()
method will collapse 1D subspaces of the dimensions ofQobj
..logm()
method returns the matrix logarithm of an operator..set_data
, .get_data
, .extract_state
, .eliminate_states
,.evaluate
and .check_isunitary
have been removed.dtype
return the representation of the data used.data_as
allow to obtain the data as a common python formats:The QobjEvo
type for storing time-dependent quantum objects has been
significantly expanded, standardized and extended. The time-dependent
coefficients are now represented using a new Coefficient
type that
may be independently created and manipulated if required.
Some highlights:
.compile()
method has been removed. Coefficients specified asQobj
is now supported.QobjEvo
for convenience. Examples.dims
, .shape
, .superrep
and .isconstant
..cte
, .use_cython
, .type
, .const
,.coeff_file
were removed.Spline
coefficient supports spline interpolations of differentCubic_Spline
coefficient has been removed..arguments(...)
method allows additional arguments to the_step_func_coeff
argument has been replaced by the order
_step_func_coeff=False
is equivalent to order=3
._step_func_coeff=True
is equivalent to order=0
. Higher valuesorder
gives spline interpolations of higher orders.bc_type
to control the boundary conditions.oper * qutip.coefficient(f, args=args)
is equivalent toqutip.QobjEvo([[oper, f]], args=args)
.def f(t, A, w)
.args
second argument is no longer needed.f(t, args)
signature will use the old method forThe solvers in QuTiP have been heavily reworked and standardized.
Under the hood solvers now make use of swappable ODE Integrators
.
Many Integrators
are included (see the list below) and
custom implementations are possible. Solvers now consistently
accept a QobjEvo
instance at the Hamiltonian or Liouvillian, or
any object which can be passed to the QobjEvo
constructor.
A breakdown of highlights follows.
All solvers:qutip.Options
is deprecated and returns a dict for backwardsmethod
option.QobjEvo
instance is accepted for most operators, e.g.,H
, c_ops
, e_ops
, a_ops
.progress_bar
option.tqdm
Python library is provided.args={"state": MESolver.StateFeedback(default=rho0)}
bdf
and adams
.dop853
.lsoda
.vern7
and vern9
. Seediag
. It only works onkrylov
. This integrator is only usable with sesolve
..e_data
attribute provides expectation values as a dictionary..expect
, the values are provided in a Python list rather than.stats
attribute changed significantly and isseed
parameter now supports supplying numpy SeedSequence
orGenerator
types.timeout
and target_tol
parameters allow the solver to exitMCSolver
map_func
parameter has been replaced by the map
option.mcsolve
now supports calculating photocurrentsparfor
parallel execution function has been removed fromqutip.parallel
. Use parallel_map
, loky_map
or mpi_pmap
instead..trace
attribute of the result.timeout
and target_tol
added.seed
parameter now supports supplying numpy SeedSequence
.a_ops
and spectra
support implementations been heavily reworked touse_secular
parameter has been removed. Use sec_cutoff=-1
instead.qutip.settings
.SESolver
and the krylov
krylovsolve
is maintained for conveniencesparse
parameter has been removed. Supply a sparse Qobj
for theFloquetBasis
classfloquet_tensor
.w_th
, and the result states are stored in the lab basis and optionallystore_floquet_state
.fmmesolve
must now be vectorizedw > 0
factorkmax
may only be supplied when usingFMESolver
Tsteps
parameter has been removed from both fsesolve
andfmmesolve
. The precompute
option to FloquetBasis
may be usedessolve
has been removed. Use the diag
integrationsesolve
or mesolve
instead.method
parameter and solver
parameters have been separated. Previouslymethod
parameter.correlation_3op
function has been added. It supports MESolver
BRMESolver
.correlation
, correlation_4op
, and correlation_ss
functions have beenmcsolve
has been removed.qutip.Propagator
, has been added for propagators.QobjEvo
.unitary_mode
and parallel
options have been removed.spectrum_ss
and spectrum_pi
have been removed anduse_pinv
parameter for spectrum
has been removed and thesolver
parameter. Use solver="pi"
There have been numerous other small changes to core QuTiP features:
qft(...)
the function that returns the quantum Fourierqutip.qip.algorithm
into qutip
.brtensor
, has been moved intoqutip.core
. See the section above on the Bloch-Redfield solvermat2vec
and vec2mat
for transforming states to andstack_columns
andunstack_columns
.liouvillian_ref
has been removed. Used liouvillian
super_to_choi
, choi_to_super
,choi_to_kraus
, choi_to_chi
and chi_to_choi
have been removed.to_choi
, to_super
, to_kraus
and to_chi
instead.Generator
as a seed.dims
parameter of all random object creation functions hasrand_unitary_haar
has been removed. Userand_unitary(distribution="haar")
instead.rand_dm_hs
and rand_dm_ginibre
have been removed.rand_dm(distribution="hs")
and rand_dm(distribution="ginibre")
rand_ket_haar
has been removed. Userand_ket(distribution="haar")
instead.target
parameter forexpand_operator
qutip.Bloch
now supports applying colours per-point, state or vector inadd_point
, add_states
, and add_vectors
.qeye_like
and qzero_like
.Previously qutip.settings
was an ordinary module. Now qutip.settings
is
an instance of a settings class. All the runtime modifiable settings for
core operations are in qutip.settings.core
. The other settings are not
modifiable at runtime.
load
. reset
and save
functions..debug
, .fortran
, .openmp_thresh
..compile
stores the compilation options for compiled coefficients..core["rtol"]
core option gives the default relative tolerance used by QuTiP..atol
has been moved to .core["atol"]
.plot_wigner
and plot_wigner_fock_distribution
to specify parameters for wigner
.Bloch3D
. The same functionality is provided by Bloch
.fig
, ax
and cmap
keyword arguments to all visualization functions.colorblind_safe
setting.Qobj
or directly from solver results with saved states.qutip.qip
has been moved into its own package, qutip-qip. Once installed, qutip-qip is available as either qutip.qip
or qutip_qip
. Some widely useful gates have been retained in qutip.gates
.qutip.control
has been moved to qutip-qtrl and once installed qutip-qtrl is available as either qutip.control
or qutip_qtrl
. Note that quitp_qtrl
is provided primarily for backwards compatibility. Improvements to optimal control will take place in the new qutip_qoc
package.qutip.lattice
has been moved into its own package, qutip-lattice. It is available from <https://github.com/qutip/qutip-lattice>
.qutip.sparse
has been removed. It contained the old sparse matrix representation and is replaced by the new implementation in qutip.data
.qutip.piqs
functions are no longer available from the qutip
namespace. They are accessible from qutip.piqs
instead.setup.py
and passing--with-idxint-64
.qutip.parfor
function has been removed. Use qutip.parallel_map
instead.qutip.graph
has been removed and replaced by SciPy's graph functions.qutip.topology
has been removed. It contained only one function berry_curvature
.~/.qutip/qutiprc
config file is no longer supported. It contained settings for the OpenMP support.three_level_atom
orbital
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4