ExcitationInitialState

Inheritance Diagram

Inheritance diagram of tenpy.simulations.ground_state_search.ExcitationInitialState

Methods

ExcitationInitialState.__init__(sim, options)

ExcitationInitialState.check_filling(p_state)

Ensure that the filling of the product state matches check_filling parameter.

ExcitationInitialState.check_total_charge(psi)

Assert that the given state has the expected charge.

ExcitationInitialState.fill_where()

Allow to specify a condition where sites should be filled.

ExcitationInitialState.fill_where__get_variables()

Define the variables which can be used in the condition of fill_where().

ExcitationInitialState.from_file()

Load the initial state from an exisiting file.

ExcitationInitialState.from_orthogonal()

ExcitationInitialState.lat_product_state([...])

Initialize from a lattice product state.

ExcitationInitialState.mps_product_state([...])

Initialize from a product state.

ExcitationInitialState.randomized()

Initialize a state with another method and then apply a RandomUnitaryEvolution.

ExcitationInitialState.run()

Build an initial state from a specified method.

Class Attributes and Properties

ExcitationInitialState.logger

class attribute.

class tenpy.simulations.ground_state_search.ExcitationInitialState(sim, options)[source]

Bases: tenpy.networks.mps.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

check_filling (from InitialStateBuilder) in InitialStateBuilder.check_filling

The desired filling as float ``p/q``, or by a tuple ``(p, q)``. [...]

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 "emtpy". [...]

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.

randomize_params

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, [...]

ranomzize_close_1

Whether to randomize/perturb with unitaries close to the identity.

use_highest_excitation

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 ranomzize_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 of orthogonal_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

OrthogonalExcitations

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 “emtpy”. 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.

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 “emtpy”. 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 exisiting 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 (separted 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().

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().

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' for lat_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 chooce a method of the class which generates the state.

Returns

psi – The generated MPS.

Return type

MPS