Difference between revisions of "Krylov.m"
(Created page with "Krylov propagation function. Avoids matrix exponentiation, but can be slow. Should be used when the Liouvillian exponential does not fit in- to the system memory, but the Lio...") |
(sync with Spinach main 3975f139: drop the 'total' option, which the function does not implement) |
||
| (10 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | Krylov propagation function. Avoids matrix exponentiation, but can be | + | {{DISPLAYTITLE:krylov.m}} __NOTOC__ |
| − | slow. Should be used when the Liouvillian exponential does not fit | + | Krylov propagation function. Avoids matrix exponentiation, but can be slow. Should be used when the Liouvillian exponential does not fit into the system memory, but the Liouvillian itself does. |
| − | + | ||
| + | ==Syntax== | ||
answer=krylov(spin_system,L,coil,rho,time_step,nsteps,output) | answer=krylov(spin_system,L,coil,rho,time_step,nsteps,output) | ||
| − | + | ==Parameters== | |
L - the Liouvillian to be used during evolution | L - the Liouvillian to be used during evolution | ||
| − | + | ||
rho - the initial state vector or a horizontal stack thereof | rho - the initial state vector or a horizontal stack thereof | ||
| − | + | ||
| − | + | output - a string giving the type of evolution that is required | |
| − | + | ||
'final' - returns the final state vector or a horizontal | 'final' - returns the final state vector or a horizontal | ||
stack thereof. | stack thereof. | ||
| − | + | ||
'trajectory' - returns the stack of state vectors giving | 'trajectory' - returns the stack of state vectors giving | ||
the trajectory of the system starting from | the trajectory of the system starting from | ||
rho with the user-specified number of steps | rho with the user-specified number of steps | ||
and step length. | and step length. | ||
| − | + | ||
| − | |||
| − | |||
| − | |||
| − | |||
'refocus' - evolves the first vector for zero steps, | 'refocus' - evolves the first vector for zero steps, | ||
second vector for one step, third vector for | second vector for one step, third vector for | ||
| Line 30: | Line 27: | ||
stage of evolution in the indirect dimension | stage of evolution in the indirect dimension | ||
after a refocusing pulse. | after a refocusing pulse. | ||
| − | + | ||
'observable' - returns the time dynamics of an observable | 'observable' - returns the time dynamics of an observable | ||
as a vector (if starting from a single ini- | as a vector (if starting from a single ini- | ||
tial state) or a matrix (if starting from a | tial state) or a matrix (if starting from a | ||
stack of initial states). | stack of initial states). | ||
| − | + | ||
'multichannel' - returns the time dynamics of several | 'multichannel' - returns the time dynamics of several | ||
observables as rows of a matrix. Note | observables as rows of a matrix. Note | ||
| Line 41: | Line 38: | ||
less efficient when there are multiple | less efficient when there are multiple | ||
destinations to screen against. | destinations to screen against. | ||
| − | + | ||
coil - the detection state, used when 'observable' is specified as | coil - the detection state, used when 'observable' is specified as | ||
the output option. If 'multichannel' is selected, the coil | the output option. If 'multichannel' is selected, the coil | ||
| Line 47: | Line 44: | ||
observable vectors. | observable vectors. | ||
| − | This function does not support | + | ==Outputs== |
| + | |||
| + | answer - a vector or a matrix, depending on the options set during | ||
| + | the call. | ||
| + | |||
| + | ==Notes== | ||
| + | This function does not support the zeeman-hilb formalism; in zeeman-wavef, L is the Hamiltonian matrix, rho is a wavefunction or a horizontal stack thereof, coil is a reference wavefunction, and observables are overlap trajectories. | ||
| + | |||
| + | We initially had a faithful implementation of the Krylov process here - subspace, orthogonalisation, projection, etc., but in all our testing it was much inferior to the reordered Taylor process that is currently implemented. | ||
| + | |||
| + | GPUs are supported, add 'gpu' to sys.enable array during calculation setup. | ||
| + | |||
| + | ==See also== | ||
| + | [[evolution.m]], [[step.m]], [[propagator.m]], [[isergen.m]], [[iserstep.m]], [[steady.m]], [[Kernel_functions]] | ||
| + | |||
| + | ''Version 2.2, authors: [[Ilya Kuprov]]'' | ||
Latest revision as of 10:58, 18 September 2026
Krylov propagation function. Avoids matrix exponentiation, but can be slow. Should be used when the Liouvillian exponential does not fit into the system memory, but the Liouvillian itself does.
Syntax
answer=krylov(spin_system,L,coil,rho,time_step,nsteps,output)
Parameters
L - the Liouvillian to be used during evolution
rho - the initial state vector or a horizontal stack thereof
output - a string giving the type of evolution that is required
'final' - returns the final state vector or a horizontal
stack thereof.
'trajectory' - returns the stack of state vectors giving
the trajectory of the system starting from
rho with the user-specified number of steps
and step length.
'refocus' - evolves the first vector for zero steps,
second vector for one step, third vector for
two steps, etc., consistent with the second
stage of evolution in the indirect dimension
after a refocusing pulse.
'observable' - returns the time dynamics of an observable
as a vector (if starting from a single ini-
tial state) or a matrix (if starting from a
stack of initial states).
'multichannel' - returns the time dynamics of several
observables as rows of a matrix. Note
that destination state screening may be
less efficient when there are multiple
destinations to screen against.
coil - the detection state, used when 'observable' is specified as
the output option. If 'multichannel' is selected, the coil
should contain multiple columns corresponding to individual
observable vectors.
Outputs
answer - a vector or a matrix, depending on the options set during
the call.
Notes
This function does not support the zeeman-hilb formalism; in zeeman-wavef, L is the Hamiltonian matrix, rho is a wavefunction or a horizontal stack thereof, coil is a reference wavefunction, and observables are overlap trajectories.
We initially had a faithful implementation of the Krylov process here - subspace, orthogonalisation, projection, etc., but in all our testing it was much inferior to the reordered Taylor process that is currently implemented.
GPUs are supported, add 'gpu' to sys.enable array during calculation setup.
See also
evolution.m, step.m, propagator.m, isergen.m, iserstep.m, steady.m, Kernel_functions
Version 2.2, authors: Ilya Kuprov