Skip to content

Commit

Permalink
Add CTMRG to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
leburgel committed Feb 8, 2024
1 parent 3310025 commit 980f94b
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Additionally, for tensors which are invariant under general global symmetries, v
lib/tensors
lib/sparse
lib/mps
lib/environments
lib/algorithms
lib/environments
lib/models
lib/utility
lib/caches
9 changes: 9 additions & 0 deletions docs/src/lib/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ Infinite MPS algorithms
:members: changebonds


Infinite PEPS algorithms
------------------------

.. autoclass:: src.algorithms.Ctmrg
:no-members:
:members: fixedpoint



Eigsolvers
----------

Expand Down
3 changes: 2 additions & 1 deletion docs/src/lib/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Environments
This section contains the API documentation for the :mod:`.environments` module.

.. autoclass:: src.environments.FiniteEnvironment

.. autoclass:: src.environments.CtmrgEnvironment
:no-members:
3 changes: 3 additions & 0 deletions docs/src/lib/mps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ Operators
.. autoclass:: src.mps.PepsTensor
.. autoclass:: src.mps.PepsSandwich
:no-members:
.. autoclass:: src.mps.UniformPeps
:no-members:
:members: UniformPeps
58 changes: 57 additions & 1 deletion src/algorithms/Ctmrg.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
classdef Ctmrg
% Corner Transfer Matrix Renormalisation Group algorithm for PEPS.
% `Corner Transfer Matrix Renormalisation Group algorithm <https://arxiv.org/abs/cond-mat/9705072>`_ for PEPS.
%
% Properties
% ----------
% tol : :class:`double`
% tolerance for convergence criterion, defaults to :code:`1e-10`.
%
% miniter : :class:`int`
% minimum number of iteration, defaults to :code:`5`.
%
% maxiter : :class:`int`
% maximum number of iteration, defaults to :code:`100`.
%
% projectortype : :class:`char`
% projector scheme used in the algorithm, currently only supports a single default
% value.
%
% trunc : :class:`struct`
% specification of truncation options, see :meth:`.Tensor.tsvd` for details.
%
% verbosity : :class:`.Verbosity`
% verbosity level of the algorithm, defaults to :code:`Verbosity.iter`.
%
% doplot : :class:`logical`
% plot progress, defaults to :code:`false`.

%% Options
properties
Expand Down Expand Up @@ -37,6 +61,38 @@
end

function [envs, new_norm, err] = fixedpoint(alg, peps_top, peps_bot, envs)
% Find the fixed point CTMRG environment of an infinite PEPS overlap.
%
% Usage
% -----
% :code:`[envs, new_norm, err] = fixedpoint(alg, peps_top, peps_bot, envs)`
%
% Arguments
% ---------
% alg : :class:`.Ctmrg`
% CTMRG algorithm.
%
% peps_top : :class:`.UniformPeps`
% top-layer uniform PEPS, usually interpreted as the 'ket' in the overlap.
%
% peps_bot : :class:`.UniformPeps`
% bottom-layer uniform PEPS, usually interpreted as the 'bra' in the overlap,
% defaults to the top layer state.
%
% envs : :class:`.CtmrgEnv`
% initial guess for the fixed point CTMRG environment.
%
% Returns
% -------
% envs : :class:`.CtmrgEnv`
% fixed point CTMRG environment.
%
% new_norm : :class:`double`
% corresponding norm.
%
% err : :class:`double`
% final error measure at convergence.

arguments
alg
peps_top
Expand Down
15 changes: 13 additions & 2 deletions src/environments/CtmrgEnvironment.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
classdef CtmrgEnvironment
%CTMRGENVIRONMENT Summary of this class goes here
% Detailed explanation goes here
% Data structure for managing CTMRG environments.
%
% Properties
% ----------
% corners : :class:`cell` of :class:`.Tensor`
% cell array of corner tensors.
%
% edges : :class:`cell` of :class:`.Tensor`
% cell array of edge tensors.
%
% Todo
% ----
% Document.

properties
corners
Expand Down
4 changes: 2 additions & 2 deletions src/mps/PepsSandwich.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
% Properties
% ----------
% top : :class:`.PepsTensor`
% top-layer PEPS tensor, usually interpreted as the 'bra' in the overlap.
% top-layer PEPS tensor, usually interpreted as the 'ket' in the overlap.
%
% bot : :class:`.PepsTensor`
% bottom-layer PEPS tensor, usually interpreted as the 'ket' in the overlap.
% bottom-layer PEPS tensor, usually interpreted as the 'bra' in the overlap.
%
% Todo
% ----
Expand Down
18 changes: 14 additions & 4 deletions src/mps/UniformPeps.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
classdef UniformPeps
% UniformPeps - Implementation of infinite translation invariant PEPS
% Implementation of infinite translation invariant PEPS
%
% Properties
% ----------
% A : :class:`cell` of :class:`.PepsTensor`
% cell array of PEPS tensors in 2D unit cell.
%
% Todo
% ----
% Document.

properties
A cell
Expand All @@ -12,15 +20,17 @@
function peps = UniformPeps(varargin)
% Usage
% -----
% :code:`peps = UniformMps(A)`
% :code:`peps = UniformPeps(A)`
%
% Arguments
% ---------
% A : :class:`cell` of :class:`PepsTensor`
% A : :class:`cell` of :class:`.PepsTensor`
% cell array of PEPS tensors in 2D unit cell.
%
% Returns
% -------
% peps : :class:`UniformPeps`
% peps : :class:`.UniformPeps`
% infinite translation-invariant PEPS.

if nargin == 0, return; end % default empty constructor

Expand Down

0 comments on commit 980f94b

Please sign in to comment.