From e9b0e98321403559125fcde9a70a2662aaab71db Mon Sep 17 00:00:00 2001 From: William Dawson Date: Tue, 27 Aug 2024 11:22:48 +0900 Subject: [PATCH] Fix CI --- UnitTests/test_chemistry.py | 6 +++--- UnitTests/test_matrix.py | 6 +++--- UnitTests/test_psmatrix.py | 2 +- UnitTests/test_psmatrixalgebra.py | 4 ++-- UnitTests/test_solvers.py | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/UnitTests/test_chemistry.py b/UnitTests/test_chemistry.py index 24829cfc..18a936f7 100644 --- a/UnitTests/test_chemistry.py +++ b/UnitTests/test_chemistry.py @@ -26,7 +26,7 @@ def create_matrices(self): fock = rand(self.mat_dim, self.mat_dim, density=1.0) if self.is_complex: fock += 1j * rand(self.mat_dim, self.mat_dim, density=1.0) - fock = fock + fock.H + fock = fock + fock.getH() else: fock = fock + fock.T overlap = rand(self.mat_dim, self.mat_dim, density=1.0) @@ -320,7 +320,7 @@ def test_wom_gc(self): we = [1.0/(1 + exp(beta*(x - mu))) for x in w] if self.is_complex: - DOrth = v @ diag(we) @ matrix(v).H + DOrth = v @ diag(we) @ matrix(v).getH() else: DOrth = v @ diag(we) @ v.T D = ISQ.dot(DOrth).dot(ISQ) @@ -381,7 +381,7 @@ def test_wom_c(self): while abs(trace(DOrth) - self.nel) > 1e-12: we = [1.0/(1 + exp(beta*(x - mu))) for x in w] if self.is_complex: - DOrth = v @ diag(we) @ matrix(v).H + DOrth = v @ diag(we) @ matrix(v).getH() else: DOrth = v @ diag(we) @ v.T D = ISQ.dot(DOrth).dot(ISQ) diff --git a/UnitTests/test_matrix.py b/UnitTests/test_matrix.py index 90ee3d14..01c495d6 100644 --- a/UnitTests/test_matrix.py +++ b/UnitTests/test_matrix.py @@ -114,7 +114,7 @@ def test_readsymmetric(self): '''Test routines to read and write matrices.''' for param in self.parameters: matrix1 = param.create_matrix(complex=self.complex, square=True) - matrix1 = matrix1 + matrix1.H + matrix1 = matrix1 + matrix1.getH() mmwrite(self.file1, matrix1) matrix2 = self.SMatrix(self.file1) matrix2.WriteToMatrixMarket(self.file2) @@ -226,7 +226,7 @@ def test_multiply(self): from random import uniform for param in self.parameters: matrix1 = param.create_matrix(complex=self.complex) - matrix2 = param.create_matrix(complex=self.complex).H + matrix2 = param.create_matrix(complex=self.complex).getH() mmwrite(self.file1, matrix1) mmwrite(self.file2, matrix2) alpha = uniform(1.0, 2.0) @@ -254,7 +254,7 @@ def test_multiply_nt(self): from random import uniform for param in self.parameters: matrix1 = param.create_matrix(complex=self.complex) - matrix2 = param.create_matrix(complex=self.complex).H + matrix2 = param.create_matrix(complex=self.complex).getH() mmwrite(self.file1, matrix1) mmwrite(self.file2, matrix2.T) alpha = uniform(1.0, 2.0) diff --git a/UnitTests/test_psmatrix.py b/UnitTests/test_psmatrix.py index 7e3ce896..6ab75e53 100644 --- a/UnitTests/test_psmatrix.py +++ b/UnitTests/test_psmatrix.py @@ -577,7 +577,7 @@ def test_conjugatetranspose(self): matrix1 = param.create_matrix(self.complex) self.write_matrix(matrix1, self.input_file1) - self.CheckMat = matrix1.H + self.CheckMat = matrix1.getH() ntmatrix1 = nt.Matrix_ps(self.input_file1, False) ntmatrix2 = nt.Matrix_ps(ntmatrix1.GetActualDimension()) diff --git a/UnitTests/test_psmatrixalgebra.py b/UnitTests/test_psmatrixalgebra.py index 8726a1a2..724ad0d2 100644 --- a/UnitTests/test_psmatrixalgebra.py +++ b/UnitTests/test_psmatrixalgebra.py @@ -300,7 +300,7 @@ def test_asymmetry(self): else: ntmatrix1 = nt.Matrix_ps(param.rows) - diff = matrix1 - matrix1.H + diff = matrix1 - matrix1.getH() ref = norm(diff.todense(), ord=inf) comp = ntmatrix1.MeasureAsymmetry() comm.barrier() @@ -320,7 +320,7 @@ def test_symmetrize(self): else: ntmatrix1 = nt.Matrix_ps(param.rows) - self.CheckMat = 0.5 * (matrix1 + matrix1.H) + self.CheckMat = 0.5 * (matrix1 + matrix1.getH()) ntmatrix1 = nt.Matrix_ps(self.input_file1, False) ntmatrix1.Symmetrize() ntmatrix1.WriteToMatrixMarket(self.result_file) diff --git a/UnitTests/test_solvers.py b/UnitTests/test_solvers.py index 953e8ef3..8282f3a5 100644 --- a/UnitTests/test_solvers.py +++ b/UnitTests/test_solvers.py @@ -663,7 +663,7 @@ def test_hornerfunction(self): val[i] = 0 for j in range(0, len(coef)): val[i] = val[i] + coef[j] * (temp**j) - temp_poly = dot(dot(vec, diag(val)), vec.H) + temp_poly = dot(dot(vec, diag(val)), vec.getH()) self.CheckMat = csr_matrix(temp_poly) # Result Matrix @@ -702,7 +702,7 @@ def test_patersonstockmeyerfunction(self): val[i] = 0 for j in range(0, len(coef)): val[i] = val[i] + coef[j] * (temp**j) - temp_poly = dot(dot(vec, diag(val)), vec.H) + temp_poly = dot(dot(vec, diag(val)), vec.getH()) self.CheckMat = csr_matrix(temp_poly) # Result Matrix @@ -1189,16 +1189,16 @@ def create_matrix(self, SPD=None, scaled=None, diag_dom=None, rank=None, from numpy import diag mat = rand(self.mat_dim, self.mat_dim, density=1.0) mat += 1j * rand(self.mat_dim, self.mat_dim, density=1.0) - mat = mat + mat.H + mat = mat + mat.getH() if SPD: - mat = mat.H.dot(mat) + mat = mat.getH().dot(mat) if diag_dom: identity_matrix = identity(self.mat_dim) mat = mat + identity_matrix * self.mat_dim if scaled: mat = (1.0 / self.mat_dim) * mat if rank: - mat = mat[rank:].dot(mat[rank:].H) + mat = mat[rank:].dot(mat[rank:].getH()) if add_gap: w, v = eigh(mat.todense()) gap = (w[-1] - w[0]) / 2.0