ExcitationInitialState
full name: tenpy.simulations.ground_state_search.ExcitationInitialState
parent module:
tenpy.simulations.ground_state_search
type: class
Inheritance Diagram
Methods
|
|
|
Ensure that the filling of the product state matches check_filling parameter. |
Assert that the given state has the expected charge. |
|
Initialize a trivial charge MPS with desired bond dimension. |
|
Allow to specify a condition where sites should be filled. |
|
Define the variables which can be used in the condition of |
|
Load the initial state from an existing file. |
|
|
|
Initialize from a lattice product state. |
|
Initialize from a product state. |
|
Initialize a state on a lattice already in a desired charge sector. |
|
Initialize a state with another method and then apply a RandomUnitaryEvolution. |
|
Build an initial state from a specified method. |
Class Attributes and Properties
class attribute. |
- class tenpy.simulations.ground_state_search.ExcitationInitialState(sim, options)[source]
Bases:
InitialStateBuilder
InitialStateBuilder for
OrthogonalExcitations
.- Parameters:
sim (
OrthogonalExcitations
) – Simulation class for which an initial state needs to be defined.options (dict) – Parameter dictionary as described below.
Options
- config ExcitationInitialState
option summary allow_incommensurate (from InitialStateBuilder) in InitialStateBuilder.lat_product_state
See :meth:`MPS.from_lat_product_state`.
charge_sector (from InitialStateBuilder) in InitialStateBuilder.mps_state_in_charge_sector
The `charge_sector` passed on to :meth:`MPS.project_onto_charge_sector`. [...]
check_filling (from InitialStateBuilder) in InitialStateBuilder.check_filling
The desired filling as float ``p/q``, or by a tuple ``(p, q)``. [...]
chi (from InitialStateBuilder) in InitialStateBuilder.desired_bond_dimension
The desired bond dimension passed on to :meth:`MPS.from_desired_bond_dimension`.
data_key (from InitialStateBuilder) in InitialStateBuilder.from_file
Key within the file to be used for loading the data. [...]
filename (from InitialStateBuilder) in InitialStateBuilder.from_file
The filename from which to load the state
fill_where (from InitialStateBuilder) in InitialStateBuilder.fill_where
A string specifying the condition where to fill sites. [...]
full_empty (from InitialStateBuilder) in InitialStateBuilder.check_filling
Definition of which local states are "full" and "empty". [...]
method (from InitialStateBuilder) in InitialStateBuilder
Selects the category of the initial state, and in particular the [...]
product_state (from InitialStateBuilder) in InitialStateBuilder.lat_product_state
The `p_state` passed on to :meth:`MPS.from_lat_product_state`.
randomize_canonicalize (from InitialStateBuilder) in InitialStateBuilder.randomized
Whether to call :meth:`MPS.canonical_form` before returning the state.
Whether to randomize/perturb with unitaries close to the identity.
Parameters for the random unitary evolution used to perturb the state a lit [...]
randomized_from_method (from InitialStateBuilder) in InitialStateBuilder.randomized
Selects another method to initialize the starting state to be randomized, [...]
If True, start from the last state in :attr:`orthogonal_to` and perturb it [...]
- option randomize_params: dict-like
Parameters for the random unitary evolution used to perturb the state a little bit in
perturb()
.
- option randomize_close_1: bool
Whether to randomize/perturb with unitaries close to the identity.
- option use_highest_excitation: bool
If True, start from the last state in
orthogonal_to
and perturb it. If False, use the ground state (=the first entry oforthogonal_to
and perturb that one a little bit.
- sim
Simulation class for which to initial a state to be used as excitation initial state.
- Type:
- check_filling(p_state)[source]
Ensure that the filling of the product state matches check_filling parameter.
Options
- option InitialStateBuilder.check_filling: None | (int, int) or float
The desired filling as float
p/q
, or by a tuple(p, q)
.None
(default) disables the check.
- option InitialStateBuilder.full_empty: (str, str)
Definition of which local states are “full” and “empty”. For example you can use
full_empty=('up', 'down')
if you have spin sites.
- check_total_charge(psi)[source]
Assert that the given state has the expected charge.
- Parameters:
psi (
MPS
) – The final, generated state.cfg (..) –
- check_total_chargetuple of int
Check that the
MPS.get_total_charge()
returns these values.
- desired_bond_dimension(chi=None)[source]
Initialize a trivial charge MPS with desired bond dimension.
See
MPS.from_desired_bond_dimension()
for details.Options
- option InitialStateBuilder.chi: int
The desired bond dimension passed on to
MPS.from_desired_bond_dimension()
.
- fill_where()[source]
Allow to specify a condition where sites should be filled.
Warning
The fill_where string is parsed with the python function eval; this is unsafe if the variable comes from an untrusted source (e.g. the internet).
Options
- option InitialStateBuilder.fill_where: str
A string specifying the condition where to fill sites. See examples in
fill_where()
.
- option InitialStateBuilder.full_empty: (str, str)
Definition of which local states are “full” and “empty”. For example you can use
full_empty=('up', 'down')
if you have spin sites.
Examples
Possible variables for conditions are specified in
fill_where__get_variables()
, for example x_ind, y_ind, u_ind.You can do arbitrary logical expressions. Example conditions: -
"x_ind == 0"
-"AND(x_ind == 0, y_ind == 0)"
-"AND(x_ind == 0, IN(y_ind, [0, 2])"
-"WITHIN(x_ind, 0.25*Lx, 0.75*Lx )"
# 0.25*Lx <= x <= 0.75&Lx
- fill_where__get_variables()[source]
Define the variables which can be used in the condition of
fill_where()
.Here, the following variables get defined.
- x_ind, y_ind, u_indint
Lattice indices of the
- epsfloat
Cutoff
1.e-12
that can get used when it is necessary to compare floats- np :
Numpy module, allowing to use any function from numpy.
- AND, OR, XOR, NOT, ANY, ALL, CLOSE, EQUAL, IN, WITHIN
Function aliases to allow logical combinations. Use for example as
AND(x_ind == 0, IN(y_ind, [0, 2, 5]))
.
- from_file()[source]
Load the initial state from an existing file.
Options
- option InitialStateBuilder.filename: str
The filename from which to load the state
- option InitialStateBuilder.data_key: str
Key within the file to be used for loading the data. Can be recursive (separated by ‘/’), see
tenpy.tools.misc.get_recursive()
.
- lat_product_state(p_state=None)[source]
Initialize from a lattice product state.
See
MPS.from_lat_product_state()
for details.Options
- option InitialStateBuilder.product_state: array of str
The p_state passed on to
MPS.from_lat_product_state()
.
- option InitialStateBuilder.allow_incommensurate: bool
See
MPS.from_lat_product_state()
.
- logger = <Logger tenpy.networks.mps.InitialStateBuilder (WARNING)>
class attribute.
- Type:
logger
- Type:
An instance of a logger; see Logging and terminal output. NB
- mps_product_state(p_state=None)[source]
Initialize from a product state.
See
MPS.from_product_state()
for details.Options
- option InitialStateBuilder.product_state: list of str
The p_state passed on to
MPS.from_product_state()
.
- mps_state_in_charge_sector(charge_sector=None, p_state=None)[source]
Initialize a state on a lattice already in a desired charge sector.
See
MPS.project_onto_charge_sector()
for details.Options
- option InitialStateBuilder.charge_sector: tuple of int
The charge_sector passed on to
MPS.project_onto_charge_sector()
. Depending on the number of sites in a lattice, only specific charge sectors can be reached.
- option InitialStateBuilder.product_state: list | np.ndarray
Optional. A product_state as in
mps_product_state()
.
- randomized()[source]
Initialize a state with another method and then apply a RandomUnitaryEvolution.
Options
- option InitialStateBuilder.randomized_from_method: str
Selects another method to initialize the starting state to be randomized, e.g.,
'lat_product_state'
forlat_product_state()
.
- option InitialStateBuilder.randomize_params: dict-like
Parameters given to the
RandomUnitaryEvolution
. In particular, you might want to set the N_steps and trunc_params[‘chi_max’]. The default is{'N_steps': 10, 'trunc_params': {'chi_max': max(100, max(psi.chi))}}
.
- option InitialStateBuilder.randomize_canonicalize: bool
Whether to call
MPS.canonical_form()
before returning the state.
- run()[source]
Build an initial state from a specified method.
Reads out the option
InitialStateBuilder.method
to choose a method of the class which generates the state.- Returns:
psi – The generated MPS.
- Return type:
MPS