quspin.tools.Floquet.Floquet_t_vec
- class quspin.tools.Floquet.Floquet_t_vec(Omega, N_const, len_T=100, N_up=0, N_down=0)[source]
Bases:
object
Creates a Floquet time vector with fixed number of points per period.
This time vector hits all stroboscopic times, and has many useful attributes. The time vector can be divided in three parts corresponding to three regimes of periodic evolution: ramp-up, constant and ramp-down.
Particularly useful for studying periodically-driven systems.
Examples
The following code shows how to use the Floquet_t_vec class.
1import numpy as np # generic math functions 2 3# 4Omega = 4.5 # drive frequency 5# define time vector with three stages of evolution, labelled by "up", "const" and "down" 6t = Floquet_t_vec(Omega, 10, len_T=10, N_up=3, N_down=2) 7print(t) 8##### attibutes referring to total time vector 9# time points values 10print(t.vals) 11# total number of periods 12print(t.N) 13# driving period 14print(t.T) 15# step size 16print(t.dt) 17# initial, final time and total time duration 18print(t.i, t.f, t.tot) 19# length of time vector and length within a period 20print(t.len, t.len_T) 21##### attributes referring to stroboscopic times only 22# indices of stroboscopic times 23print(t.strobo.inds) 24# values of stroboscopic times 25print(t.strobo.vals) 26##### attributes relating to the "up" stage of the evolution 27# time values for the "up"-stage 28print(t.up.vals) 29# initial, final time and total time of "up" duration (similar for "const" and "down") 30print(t.up.i, t.up.f, t.up.tot)
- __init__(Omega, N_const, len_T=100, N_up=0, N_down=0)[source]
- Parameters:
- Omegafloat
Drive frequency.
- N_constint
Number of time periods in the constant part (period) of the time vector.
- len_Tint
Number of time points within a single period. N.B. the last period interval is assumed open on the right, i.e. [0,T) and the point T is NOT counted towards ‘len_T’.
- N_upint, optional
Number of time periods in the up-part (period) of time vector.
- N_downint, optional
Number of time periods in the down-part (period) of time vector.
Methods
__init__
(Omega, N_const[, len_T, N_up, N_down])get_coordinates
(index)Returns (period number, index within period) of the Floquet_t_vec value stored at index.
Attributes
total number of periods.
drive period.
refers to time vector of const-part (regime).
refers to time vector of down-part (regime).
time vector step size.
final time value.
initial time value.
length of time vector.
number of time points within one period, assumed half-open; [0,T).
shape of array.
calculates stroboscopic times in time vector with period length len_T and assigns them as attributes:
total time duration; _.f - _.i .
refers to time vector of up-part (regime).
time vector values.
- property N
total number of periods.
- Type:
int
- property T
drive period.
- Type:
float
- property const
refers to time vector of const-part (regime).
Inherits all attributes (e.g. _.const.strobo.inds) except _.T, _.dt, and _.lenT.
- Type:
obj
- property down
refers to time vector of down-part (regime).
Inherits all attributes (e.g. _.down.strobo.inds) except _.T, _.dt, and _.lenT.
Requires optional __init___ parameter N_down to be specified.
- Type:
obj
- property dt
time vector step size.
- Type:
float
- property f
final time value.
- Type:
foat
- get_coordinates(index)[source]
Returns (period number, index within period) of the Floquet_t_vec value stored at index.
- Parameters:
- indexint
Index, to compute the Floquet_t_vec coordinates of.
- Returns:
- tuple
(i,j) such that t_evolve[t_evolve.strobo.inds[i] + j] = t_evolve[index].
Notes
This function finds the indegers (i,j), such that t_evolve[t_evolve.strobo.inds[i-1] + j] = t_evolve[index].
The function may return wrong results if the spacing between two consecutive (i.e. nonstroboscopic) Floquet_t_vec values is smaller than 1E-15.
Examples
>>> t = Floquet_t_vec(10.0,10) # define a Floquet vector >>> index = 145 # pick a random index >>> print(t[index]) # check element >>> (i,j) = t.get_coordinates(index) # decompose index into stroboscopic coordinates >>> print( t[t.strobo.inds[i] + j] ) # we obtain back original element
- property i
initial time value.
- Type:
float
- property len
length of time vector.
- Type:
int
- property len_T
number of time points within one period, assumed half-open; [0,T).
- Type:
int
- property shape
shape of array.
- Type:
tuple
- property strobo
calculates stroboscopic times in time vector with period length len_T and assigns them as attributes:
- _.strobo.indsnumpy.ndarray(int)
indices of stroboscopic times (full periods).
- _.strobo.valsnumpy.ndarray(float)
values of stroboscopic times (full periods).
- Type:
obj
- property tot
total time duration; _.f - _.i .
- Type:
float
- property up
refers to time vector of up-part (regime).
Inherits all attributes (e.g. _.up.strobo.inds) except _.T, _.dt, and _.lenT.
Requires optional __init___ parameter N_up to be specified.
- Type:
obj
- property vals
time vector values.
- Type:
np.ndarray(float)