Skip to content

Functions for finite size systems: Low level functions: Problems with discrete approximation of the derivative

kchabuda edited this page Jul 17, 2021 · 1 revision

Table of Contents

fin2_FoM_FoMD_optbd

fin2_FoM_FoMD_optbd(n,d,bc,ch,chp,epsilon,cini=None,a0ini=None,imprecision=10**-2,bdlmax=100,alwaysbdlmax=False,lherm=True,bdpsimax=100,alwaysbdpsimax=False)

Iterative optimization of FoM/FoMD over SLD MPO and initial wave function MPS and also a check of convergence with increasing bond dimensions. Function for finite size systems. Version with two channels separated by epsilon.

Parameters:

  n: number of sites in TN
  d: dimension of the local Hilbert space (dimension of the physical index)
  bc: boundary conditions, 'O' for OBC, 'P' for PBC
  ch: MPO for a quantum channel at the value of estimated parameter phi=phi_0, expected list of length n of ndarrays of a shape (bd,bd,d**2,d**2) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d**2,d**2,n) for PBC
  chp: MPO for a quantum channel at the value of estimated parameter phi=phi_0+epsilon, expected list of length n of ndarrays of a shape (bd,bd,d**2,d**2) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d**2,d**2,n) for PBC
  epsilon: value of a separation between estimated parameters encoded in ch and chp, float
  cini: initial MPO for the SLD, expected list of length n of ndarrays of a shape (bd,bd,d,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,d,n) for PBC
  a0ini: initial MPS for the initial wave function, expected list of length n of ndarrays of a shape (bd,bd,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,n) for PBC
  imprecision: expected imprecision of the end results, default value is 10**-2
  bdlmax: maximal value of bd for SLD MPO, default value is 100
  alwaysbdlmax: boolean value, True if the maximal value of bd for SLD MPO has to be reached, otherwise False (default value)
  lherm: boolean value, True (default value) when Hermitian gauge is imposed on SLD MPO, otherwise False
  bdpsimax: maximal value of bd for the initial wave function MPS, default value is 100
  alwaysbdpsimax: boolean value, True if the maximal value of bd for initial wave function MPS has to be reached, otherwise False (default value)

Returns:

  result: optimal value of FoM/FoMD
  resultm: matrix describing FoM/FoMD as a function of bd of respectively SLD MPO [rows] and the initial wave function MPS [columns]
  c: optimal MPO for SLD
  a0: optimal MPS for initial wave function

fin2_FoM_optbd

fin2_FoM_optbd(n,d,bc,a,b,epsilon,cini=None,imprecision=10**-2,bdlmax=100,alwaysbdlmax=False,lherm=True)

Optimization of FoM over SLD MPO and also check of convergence in bond dimension. Function for finite size systems. Version with two states separated by epsilon.

Parameters:

  n: number of sites in TN
  d: dimension of local Hilbert space (dimension of physical index)
  bc: boundary conditions, 'O' for OBC, 'P' for PBC
  a: MPO for the density matrix at the value of estimated parameter phi=phi_0, expected list of length n of ndarrays of a shape (bd,bd,d,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,d,n) for PBC
  b: MPO for the density matrix at the value of estimated parameter phi=phi_0+epsilon, expected list of length n of ndarrays of a shape (bd,bd,d,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,d,n) for PBC
  epsilon: value of a separation between estimated parameters encoded in a and b, float
  cini: initial MPO for SLD, expected list of length n of ndarrays of a shape (bd,bd,d,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,d,n) for PBC
  imprecision: expected imprecision of the end results, default value is 10**-2
  bdlmax: maximal value of bd for SLD MPO, default value is 100
  alwaysbdlmax: boolean value, True if maximal value of bd for SLD MPO have to be reached, otherwise False (default value)
  lherm: boolean value, True (default value) when Hermitian gauge is imposed on SLD MPO, otherwise False

Returns:

  result: optimal value of FoM
  resultv: vector describing FoM as a function of bd of the SLD MPO
  c: optimal MPO for SLD

fin2_FoMD_optbd

fin2_FoMD_optbd(n,d,bc,c2d,cd,cpd,epsilon,a0ini=None,imprecision=10**-2,bdpsimax=100,alwaysbdpsimax=False)

Optimization of FoMD over initial wave function MPS and also check of convergence when increasing the bond dimension. Function for finite size systems. Version with two dual SLDs separated by epsilon.

Parameters:

  n: number of sites in TN
  d: dimension of local Hilbert space (dimension of physical index)
  bc: boundary conditions, 'O' for OBC, 'P' for PBC
  c2d: MPO for square of dual of SLD at the value of estimated parameter phi=-phi_0, expected list of length n of ndarrays of a shape (bd,bd,d,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,d,n) for PBC
  cd: MPO for dual of SLD at the value of estimated parameter phi=-phi_0, expected list of length n of ndarrays of a shape (bd,bd,d,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,d,n) for PBC
  cpd: MPO for dual of SLD at the value of estimated parameter phi=-(phi_0+epsilon), expected list of length n of ndarrays of a shape (bd,bd,d,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,d,n) for PBC
  epsilon: value of a separation between estimated parameters encoded in cd and cpd, float
  a0ini: initial MPS for initial wave function, expected list of length n of ndarrays of a shape (bd,bd,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,n) for PBC
  imprecision: expected imprecision of the end results, default value is 10**-2
  bdpsimax: maximal value of bd for initial wave function MPS, default value is 100
  alwaysbdpsimax: boolean value, True if maximal value of bd for initial wave function MPS have to be reached, otherwise False (default value)

Returns:

  result: optimal value of FoMD
  resultv: vector describing FoMD in function of bd of initial wave function MPS
  a0: optimal MPS for initial wave function

fin2_FoM_FoMD_optm

fin2_FoM_FoMD_optm(n,d,bc,c,a0,ch,chp,epsilon,imprecision=10**-2,lherm=True)

Iterative optimization of FoM/FoMD over SLD MPO and initial wave function MPS. Function for finite size systems. Version with two channels separated by epsilon.

Parameters:

  n: number of sites in TN
  d: dimension of local Hilbert space (dimension of physical index)
  bc: boundary conditions, 'O' for OBC, 'P' for PBC
  c: MPO for SLD, expected list of length n of ndarrays of a shape (bd,bd,d,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,d,n) for PBC
  a0: MPS for initial wave function, expected list of length n of ndarrays of a shape (bd,bd,d) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d,n) for PBC
  ch: MPO for quantum channel at the value of estimated parameter phi=phi_0, expected list of length n of ndarrays of a shape (bd,bd,d**2,d**2) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d**2,d**2,n) for PBC
  chp: MPO for quantum channel at the value of estimated parameter phi=phi_0+epsilon, expected list of length n of ndarrays of a shape (bd,bd,d**2,d**2) for OBC (bd can vary between sites), or ndarray of a shape (bd,bd,d**2,d**2,n) for PBC
  epsilon: value of a separation between estimated parameters encoded in ch and chp, float
  imprecision: expected imprecision of the end results, default value is 10**-2
  lherm: boolean value, True (default value) when Hermitian gauge is imposed on SLD MPO, otherwise False

Returns:

  fval: optimal value of FoM/FoMD
  c: optimal MPO for SLD
  a0: optimal MPS for initial wave function

fin2_FoM_OBC_optm

fin2_FoM_OBC_optm(a,b,epsilon,c,imprecision=10**-2,lherm=True)

Optimization of FoM over MPO for SLD. Function for finite size systems with OBC. Version with two states separated by epsilon.

Parameters:

  a: MPO for the density matrix at the value of estimated parameter phi=phi_0, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  b: MPO for the density matrix at the value of estimated parameter phi=phi_0+epsilon, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  epsilon: value of a separation between estimated parameters encoded in a and b, float
  c: MPO for the SLD, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  imprecision: expected imprecision of the end results, default value is 10**-2
  lherm: boolean value, True (default value) when Hermitian gauge is imposed on SLD MPO, otherwise False

Returns:

  fomval: optimal value of FoM
  c: optimal MPO for SLD

fin2_FoM_PBC_optm

fin2_FoM_PBC_optm(a,b,epsilon,c,imprecision=10**-2,lherm=True)

Optimization of FoM over MPO for SLD. Function for finite size systems with PBC. Version with two states separated by epsilon.

Parameters:

  a: MPO for the density matrix at the value of estimated parameter phi=phi_0, expected ndarray of a shape (bd,bd,d,d,n)
  b: MPO for the density matrix at the value of estimated parameter phi=phi_0+epsilon, expected ndarray of a shape (bd,bd,d,d,n)
  epsilon: value of a separation between estimated parameters encoded in a and b, float
  c: MPO for the SLD, expected ndarray of a shape (bd,bd,d,d,n)
  imprecision: expected imprecision of the end results, default value is 10**-2
  lherm: boolean value, True (default value) when Hermitian gauge is imposed on SLD MPO, otherwise False

Returns:

  fomval: optimal value of FoM
  c: optimal MPO for SLD

fin2_FoMD_OBC_optm

fin2_FoMD_OBC_optm(c2d,cd,cpd,epsilon,a0,imprecision=10**-2)

Optimization of FoMD over MPS for initial wave function. Function for finite size systems with OBC. Version with two dual SLDs separated by epsilon.

Parameters:

  c2d: MPO for the square of the dual of the SLD at the value of estimated parameter phi=-phi_0, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  cd: MPO for the dual of the SLD at the value of estimated parameter phi=-phi_0, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  cpd: MPO for the dual of the SLD at the value of estimated parameter phi=-(phi_0+epsilon), expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  epsilon: value of a separation between estimated parameters encoded in cd and cpd, float
  a0: MPS for the initial wave function, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  imprecision: expected imprecision of the end results, default value is 10**-2

Returns:

  fomdval: optimal value of FoMD
  a0: optimal MPS for the initial wave function

fin2_FoMD_PBC_optm

fin2_FoMD_PBC_optm(c2d,cd,cpd,epsilon,a0,imprecision=10**-2)

Optimization of FoMD over MPS for initial wave function. Function for finite size systems with PBC. Version with two dual SLDs separated by epsilon.

Parameters:

  c2d: MPO for square of dual of SLD at the value of estimated parameter phi=-phi_0, expected ndarray of a shape (bd,bd,d,d,n)
  cd: MPO for dual of SLD at the value of estimated parameter phi=-phi_0, expected ndarray of a shape (bd,bd,d,d,n)
  cpd: MPO for dual of SLD at the value of estimated parameter phi=-(phi_0+epsilon), expected ndarray of a shape (bd,bd,d,d,n)
  epsilon: value of a separation between estimated parameters encoded in cd and cpd, float
  a0: MPS for initial wave function, expected ndarray of a shape (bd,bd,d,n)
  imprecision: expected imprecision of the end results, default value is 10**-2

Returns:

  fomdval: optimal value of FoMD
  a0: optimal MPS for initial wave function

fin2_FoM_OBC_val

fin2_FoM_OBC_val(a,b,epsilon,c)

Calculate value of FoM. Function for finite size systems with OBC. Version with two states separated by epsilon.

Parameters:

  a: MPO for density matrix at the value of estimated parameter phi=phi_0, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  b: MPO for density matrix at the value of estimated parameter phi=phi_0+epsilon, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  epsilon: value of a separation between estimated parameters encoded in a and b, float
  c: MPO for SLD, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)

Returns:

  fomval: value of FoM

fin2_FoM_PBC_val

fin2_FoM_PBC_val(a,b,epsilon,c)

Calculate value of FoM. Function for finite size systems with PBC. Version with two states separated by epsilon.

Parameters:

  a: MPO for density matrix at the value of estimated parameter phi=phi_0, expected ndarray of a shape (bd,bd,d,d,n)
  b: MPO for density matrix at the value of estimated parameter phi=phi_0+epsilon, expected ndarray of a shape (bd,bd,d,d,n)
  epsilon: value of a separation between estimated parameters encoded in a and b, float
  c: MPO for SLD, expected ndarray of a shape (bd,bd,d,d,n)

Returns:

  fomval: value of FoM

fin2_FoMD_OBC_val

fin2_FoMD_OBC_val(c2d,cd,cpd,epsilon,a0)

Calculate value of FoMD. Function for finite size systems with OBC. Version with two dual SLDs separated by epsilon.

Parameters:

  c2d: MPO for square of dual of SLD at the value of estimated parameter phi=-phi_0, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  cd: MPO for dual of SLD at the value of estimated parameter phi=-phi_0, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  cpd: MPO for dual of SLD at the value of estimated parameter phi=-(phi_0+epsilon), expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)
  epsilon: value of a separation between estimated parameters encoded in cd and cpd, float
  a0: MPS for initial wave function, expected list of length n of ndarrays of a shape (bd,bd,d,d) (bd can vary between sites)

Returns:

  fomdval: value of FoMD

fin2_FoMD_PBC_val

fin2_FoMD_PBC_val(c2d,cd,cpd,epsilon,a0)

Calculate value of FoMD. Function for finite size systems with PBC. Version with two dual SLDs separated by epsilon.

Parameters:

  c2d: MPO for square of dual of SLD at the value of estimated parameter phi=-phi_0, expected ndarray of a shape (bd,bd,d,d,n)
  cd: MPO for dual of SLD at the value of estimated parameter phi=-phi_0, expected ndarray of a shape (bd,bd,d,d,n)
  cpd: MPO for dual of SLD at the value of estimated parameter phi=-(phi_0+epsilon), expected ndarray of a shape (bd,bd,d,d,n)
  epsilon: value of a separation between estimated parameters encoded in cd and cpd, float
  a0: MPS for initial wave function, expected ndarray of a shape (bd,bd,d,n)

Returns:

  fomdval: value of FoMD