Skip to content

Commit

Permalink
Merge branch 'main' into updated_to_sparse
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisRalli authored Oct 8, 2024
2 parents 6eef95a + d33d50e commit ec33459
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion symmer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ def gram_schmidt_from_quantum_state(state:Union[np.array, list, QuantumState]) -

return M


def get_sparse_matrix_large_pauliwordop(P_op: PauliwordOp) -> csr_matrix:
"""
In order to build the sparse matrix (e.g. above 18 qubits), this function goes through each pauli term
Expand Down
13 changes: 1 addition & 12 deletions tests/test_symmer_utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from symmer.operators import PauliwordOp, QuantumState
from symmer.utils import (exact_gs_energy, random_anitcomm_2n_1_PauliwordOp,Draw_molecule,
from symmer.utils import (exact_gs_energy, random_anitcomm_2n_1_PauliwordOp,
tensor_list, gram_schmidt_from_quantum_state, product_list,
get_sparse_matrix_large_pauliwordop, matrix_allclose)
import numpy as np
from openfermion import QubitOperator
import py3Dmol

H2_sto3g = {'qubit_encoding': 'jordan_wigner',
'unit': 'angstrom',
Expand Down Expand Up @@ -446,16 +445,6 @@ def test_gram_schmidt_from_quantum_state_numpy_array():
assert np.allclose(U_gram[:, 0], psi_norm), 'first column of U_gram not correct'
assert np.allclose(U_gram @ U_gram.conj().T, np.eye(2 ** nq)), 'U_gram not unitary'


def test_Draw_molecule():

xyz = H2_sto3g['geometry']
viewer_sphere = Draw_molecule(xyz, width=400, height=400, style='sphere')
assert isinstance(viewer_sphere, py3Dmol.view)

viewer_stick = Draw_molecule(xyz, width=400, height=400, style='stick')
assert isinstance(viewer_stick, py3Dmol.view)

def test_get_sparse_matrix_large_pauliwordop():
for nq in range(2,6):
n_terms = 10*nq
Expand Down

0 comments on commit ec33459

Please sign in to comment.