mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-16 04:23:41 +02:00
mat_mat_op renamed to _mat_mat_op
This commit is contained in:
parent
a24e608413
commit
ad53f28e46
3 changed files with 9 additions and 9 deletions
|
@ -5,7 +5,7 @@ import matplotlib.pyplot as plt
|
||||||
import scipy.linalg
|
import scipy.linalg
|
||||||
from .pyerrors import Obs, dump_object
|
from .pyerrors import Obs, dump_object
|
||||||
from .fits import standard_fit
|
from .fits import standard_fit
|
||||||
from .linalg import eigh, mat_mat_op
|
from .linalg import eigh, inv, cholesky
|
||||||
from .roots import find_root
|
from .roots import find_root
|
||||||
|
|
||||||
|
|
||||||
|
@ -187,10 +187,10 @@ class Corr:
|
||||||
def Eigenvalue(self, t0, state=1):
|
def Eigenvalue(self, t0, state=1):
|
||||||
G = self.smearing_symmetric()
|
G = self.smearing_symmetric()
|
||||||
G0 = G.content[t0]
|
G0 = G.content[t0]
|
||||||
L = mat_mat_op(anp.linalg.cholesky, G0)
|
L = cholesky(G0)
|
||||||
Li = mat_mat_op(anp.linalg.inv, L)
|
Li = inv(L)
|
||||||
LT = L.T
|
LT = L.T
|
||||||
LTi = mat_mat_op(anp.linalg.inv, LT)
|
LTi = inv(LT)
|
||||||
newcontent = []
|
newcontent = []
|
||||||
for t in range(self.T):
|
for t in range(self.T):
|
||||||
Gt = G.content[t]
|
Gt = G.content[t]
|
||||||
|
|
|
@ -171,11 +171,11 @@ def matmul(*operands):
|
||||||
|
|
||||||
|
|
||||||
def inv(x):
|
def inv(x):
|
||||||
return mat_mat_op(anp.linalg.inv, x)
|
return _mat_mat_op(anp.linalg.inv, x)
|
||||||
|
|
||||||
|
|
||||||
def cholesky(x):
|
def cholesky(x):
|
||||||
return mat_mat_op(anp.linalg.cholesky, x)
|
return _mat_mat_op(anp.linalg.cholesky, x)
|
||||||
|
|
||||||
|
|
||||||
def scalar_mat_op(op, obs, **kwargs):
|
def scalar_mat_op(op, obs, **kwargs):
|
||||||
|
@ -203,7 +203,7 @@ def scalar_mat_op(op, obs, **kwargs):
|
||||||
return derived_observable(_mat, raveled_obs, **kwargs)
|
return derived_observable(_mat, raveled_obs, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def mat_mat_op(op, obs, **kwargs):
|
def _mat_mat_op(op, obs, **kwargs):
|
||||||
"""Computes the matrix to matrix operation op to a given matrix of Obs."""
|
"""Computes the matrix to matrix operation op to a given matrix of Obs."""
|
||||||
# Use real representation to calculate matrix operations for complex matrices
|
# Use real representation to calculate matrix operations for complex matrices
|
||||||
if isinstance(obs.ravel()[0], CObs):
|
if isinstance(obs.ravel()[0], CObs):
|
||||||
|
|
|
@ -27,8 +27,8 @@ class Npr_matrix(np.ndarray):
|
||||||
raise Exception('g5H only works for 12x12 matrices.')
|
raise Exception('g5H only works for 12x12 matrices.')
|
||||||
extended_g5 = np.kron(np.eye(3, dtype=int), gamma5)
|
extended_g5 = np.kron(np.eye(3, dtype=int), gamma5)
|
||||||
return Npr_matrix(matmul(extended_g5, self.conj().T, extended_g5),
|
return Npr_matrix(matmul(extended_g5, self.conj().T, extended_g5),
|
||||||
mom_in=self.mom_out,
|
mom_in=self.mom_out,
|
||||||
mom_out=self.mom_in)
|
mom_out=self.mom_in)
|
||||||
|
|
||||||
def _propagate_mom(self, other, name):
|
def _propagate_mom(self, other, name):
|
||||||
s_mom = getattr(self, name, None)
|
s_mom = getattr(self, name, None)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue