Configuration

Main

class config.MAINARGS[source]

Main simulation options. The default settings can be modified through command line arguments as follows --<option-name> desired-value

Variables
  • omp_cores (int:) – number of OpenMP cores. Default: 1

  • instate (str or Path) – input state file. Default: None

  • instate_noise (float) – magnitude of noise applied to the input state, if any. Default: 0.0

  • ipeps_init_type (str) – initialization of the trial iPEPS state, if no instate is provided. Default: RANDOM

  • out_prefix (str) – output file prefix. Default: output

  • bond_dim (int) – iPEPS auxiliary bond dimension. Default: 1

  • chi (int) – environment bond dimension. Default: 20

  • opt_max_iter (int) – maximal number of optimization steps. Default: 100

  • opt_resume (str or Path) – resume from checkpoint file. Default: None

  • opt_resume_override_params (bool) – override optimizer parameters stored in checkpoint. Default: False

  • seed (int) – PRNG seed. Default: 0

Global

class config.GLOBALARGS[source]

Holds global configuration options. The default settings can be modified through command line arguments as follows --GLOBALARGS_<variable-name> desired-value

Variables
  • dtype (torch.dtype) – data type of all torch.tensor. Default: torch.float64

  • device (str) – device on which all the torch.tensors are stored. Default: 'cpu'

  • gpu (str) – gpu used for optional acceleration. It might be desirable to store the model and all the intermediates of CTM on CPU and compute only the core parts of the expensive CTM step on GPU. Default: ''

Corner Transfer Matrix Algorithm

class config.CTMARGS[source]

Holds configuration of the CTM algorithm. The default settings can be modified through command line arguments as follows --CTMARGS_<variable-name> desired-value

Variables
  • ctm_max_iter (int) – maximum iterations of directional CTM algorithm. Default: 50

  • ctm_env_init_type (str) – default initialization method for ENV objects. Default: 'CTMRG'

  • ctm_conv_tol (float) – threshold for convergence of CTM algorithm. Default: '1.0e-10'

  • conv_check_cpu (bool) – execute CTM convergence check on cpu (if applicable). Default: False

  • projector_method (str) –

    method used to construct projectors which facilitate truncation of environment bond dimension \(\chi\) within CTM algorithm

    • 4X4: Projectors are built from two halfs of 4x4 tensor network

    • 4X2: Projectors are built from two enlarged corners (2x2) making up a 4x2 (or 2x4) tensor network

    Default: '4X4'

  • projector_svd_method (str) –

    singular/eigen value decomposition algorithm used in the construction of the projectors:

    • 'GESDD': pytorch wrapper of LAPACK’s gesdd

    • 'RSVD': randomized SVD

    • 'SYMEIG': pytorch wrapper of LAPACK’s dsyev for symmetric matrices

    • 'SYMARP': scipy wrapper of ARPACK’s dsaupd for symmetric matrices

    • 'ARP': scipy wrapper of ARPACK’s svds for general matrices

    Default: 'SYMEIG' for c4v-symmetric CTM, otherwise 'GESDD'

  • projector_svd_reltol (float) – relative threshold on the magnitude of the smallest elements of singular value spectrum used in the construction of projectors. Default: 1.0e-8

  • ctm_move_sequence (list[tuple(int,int)]) –

    sequence of directional moves within single CTM iteration. The possible directions are encoded as tuples(int,int)

    • up = (0,-1)

    • left = (-1,0)

    • down = (0,1)

    • right = (1,0)

    Default: [(0,-1), (-1,0), (0,1), (1,0)]

  • fwd_checkpoint_c2x2 (bool) – recompute forward pass of enlarged corner functions (c2x2_*) during backward pass within optimization to save memory. Default: False

  • fwd_checkpoint_halves (bool) – recompute forward pass of halves functions (halves_of_4x4_*) during backward pass within optimization to save memory. Default: False

  • fwd_checkpoint_projectors (bool) – recompute forward pass of projector construction (except SVD) during backward pass within optimization to save memory. Default: False

  • fwd_checkpoint_absorb (bool) – recompute forward pass of absorp and truncate functions (absorb_truncate_*) during backward pass within optimization to save memory. Default: False

  • fwd_checkpoint_move (bool) – recompute forward pass of whole ctm_MOVE during backward pass. Default: False

FPCM related options

Variables
  • fpcm_init_iter (int) – minimal number of CTM steps before FPCM acceleration step is attempted. Default: 1

  • fpcm_freq (int) – frequency of FPCM steps per CTM steps. Default: -1

  • fpcm_isogauge_tol (float) – tolerance on gauging the uniform MPS built from half-row/-column tensor T. Default: 1.0e-14.

  • fpcm_fpt_tol (float) – tolerance on convergence within FPCM step. Default: 1.0e-8

Logging and Debugging options

Variables
  • ctm_logging – log debug statements into log file. Default: False

  • verbosity_initialization (int) – verbosity of initialization method for ENV objects. Default: 0

  • verbosity_ctm_convergence (int) – verbosity of evaluation of CTM convergence criterion. Default: 0

  • verbosity_projectors (int) – verbosity of projector construction. Default: 0

  • verbosity_ctm_move (int) – verbosity of directional CTM moves. Default: 0

  • verbosity_rdm (int) – verbosity of reduced density matrix routines. Default: 0

  • step_core_gpu (bool) – assuming the default device is CPU, offload the core part of the CTM step to GPU. Together with CTM step checkpointing fwd_checkpoint_move allows to store all intermediates on CPU.

Optimization

class config.OPTARGS[source]

Holds configuration of the optimization. The default settings can be modified through command line arguments as follows --OPTARGS_<variable-name> desired-value

General options

Variables
  • opt_ctm_reinit (bool) – reinitialize environment from scratch within every loss function evaluation. Default: True

  • lr (float) – initial learning rate. Default: 1.0

  • line_search (str) – line search algorithm to use. L-BFGS supports 'strong_wolfe' and 'backtracking'. SGD supports just 'backtracking'. Default: None.

  • line_search_ctm_reinit (bool) – recompute environment from scratch at each step within line search algorithm. Default: True.

  • line_search_svd_method (str) – eigen decompostion method to use within line search environment computation. See options in config.CTMARGS. Default: 'DEFAULT' which depends on the particular CTM algorithm.

L-BFGS related options

Variables
  • tolerance_grad (float) – stopping criterion wrt. norm of the gradient (which norm ? See torch.optim.LBFGS). Default: 1.0e-5

  • tolerance_change (float) – stopping criterion wrt. change of the loss function. Default: 1.0e-9

  • max_iter_per_epoch (int) – maximum number of optimizer iterations per epoch. Default: 1

  • history_size (int) – number past of directions used to approximate inverse Hessian. Default: 100.

SGD related options

Variables
  • momentum (float) – momentum used in the SGD step

  • dampening (float) – dampening used in the SGD step

Gradients through finite differences

Variables
  • fd_eps (float) – magnitude of displacement when computing the forward difference \(E(x_0 + \textrm{fd_eps})-E(x_0)/\textrm{fd_eps}\). Default: 1.0e-4

  • fd_ctm_reinit – recompute environment from scratch after applying the displacement. Default: True

Logging

Variables
  • opt_logging (bool) – turns on recording of additional data from optimization, such as CTM convergence, timings, gradients, etc. The information is logged in file {out_prefix}_log.json. Default: True

  • opt_log_grad (bool) – log values of gradient. Default: False

  • verbosity_opt_epoch (int) – verbosity within optimization epoch. Default: 1