Skip to content

Commit 049182c

Browse files
authored
Merge pull request #43 from isi-usc-edu/42-indexerror-when-intializing-doublefactorized-block-encoding
fixes #42 and increases version
2 parents c5d9ff3 + a6b9c7c commit 049182c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/pyLIQTR/BlockEncodings/DoubleFactorized.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def __init__(self,ProblemInstance,df_error_threshold:float=1e-3,sf_error_thresho
103103
@cached_property
104104
def alpha(self):
105105
"""returns the double factorized Hamiltonian norm."""
106-
return self.PI.get_alpha(encoding='DF',df_cutoffs=self.Xi_l_data)
106+
return self.PI.get_alpha(encoding='DF',sf_error_threshold=self.sf_error_threshold,df_cutoffs=self.Xi_l_data)
107107

108108
@cached_property
109109
def control_registers(self) -> Tuple[Register]:

src/pyLIQTR/BlockEncodings/tests/test_DoubleFactorized.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ def h2_instance(self):
9393
def df_encoding(self, h2_instance):
9494
return getEncoding(instance=h2_instance, encoding=VALID_ENCODINGS.DoubleFactorized,df_error_threshold=1e-2,br=4,step_error=1e-1)
9595

96+
def test_DoubleFactorized_alpha(self, h2_instance):
97+
'''
98+
Tests alpha is calculated without raising errors.
99+
'''
100+
encoding = getEncoding(instance=h2_instance, encoding=VALID_ENCODINGS.DoubleFactorized,df_error_threshold=1e-2,br=4, sf_error_threshold=1e-2)
101+
norm = encoding.alpha
102+
96103
def test_DoubleFactorized_decomposes(self, df_encoding):
97104
'''
98105
Tests gate decomposition existence.

src/pyLIQTR/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.3.5"
1+
__version__ = "1.3.6"

0 commit comments

Comments
 (0)