Skip to content

Commit d89c643

Browse files
authored
Merge branch 'master' into mh-fix-1064
2 parents 0803f67 + 5f5beee commit d89c643

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

.github/workflows/scorecard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
persist-credentials: false
6262

6363
- name: Run Scorecard analysis
64-
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
64+
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
6565
with:
6666
# Save the results
6767
results_file: scorecard-results.sarif

src/openfermion/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,20 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12+
1213
import os
14+
import random
15+
import pytest
16+
import numpy as np
1317

1418

1519
def pytest_configure(config):
1620
# fail tests when using deprecated cirq functionality
1721
os.environ['CIRQ_TESTING'] = "true"
22+
23+
24+
@pytest.fixture(autouse=True)
25+
def set_random_seed():
26+
"""Set a fixed random seed when testing."""
27+
random.seed(0)
28+
np.random.seed(0)

src/openfermion/resource_estimates/pbc/hamiltonian/cc_extensions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def build_approximate_eris(krcc_inst, eri_helper, eris=None):
6969
eri_kpt = eri_helper.get_eri(kpts) / nkpts
7070
if dtype == float:
7171
eri_kpt = eri_kpt.real
72-
eri_kpt = eri_kpt
7372
for kp, kq, kr in khelper.symm_map[(ikp, ikq, ikr)]:
7473
eri_kpt_symm = khelper.transform_symm(eri_kpt, kp, kq, kr).transpose(0, 2, 1, 3)
7574
out_eris.oooo[kp, kr, kq] = eri_kpt_symm[:nocc, :nocc, :nocc, :nocc]

src/openfermion/resource_estimates/pbc/thc/factorizations/isdf.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -575,18 +575,14 @@ def kpoint_isdf_double_translation(
575575
num_kpts = len(kpts)
576576
num_interp_points = xi.shape[1]
577577
assert xi.shape == (num_grid_points, num_interp_points)
578-
(
579-
g_vectors,
580-
g_mapping,
581-
g_mapping_unique,
582-
delta_gs_unique,
583-
) = build_g_vector_mappings_double_translation(df_inst.cell, kpts, momentum_map)
578+
(g_vectors, g_mapping, g_mapping_unique, delta_gs_unique) = (
579+
build_g_vector_mappings_double_translation(df_inst.cell, kpts, momentum_map)
580+
)
584581
if only_unique_g:
585582
g_mapping = g_mapping_unique
586583
delta_gs = delta_gs_unique
587584
else:
588585
delta_gs = [g_vectors] * num_kpts
589-
g_mapping = g_mapping
590586
zeta = np.zeros((num_kpts,), dtype=object)
591587
for iq in range(num_kpts):
592588
num_g = len(delta_gs[iq])
@@ -914,7 +910,6 @@ def solve_kmeans_kpisdf(
914910
weighting_function = np.einsum(
915911
"kRi,kRi->R", bloch_orbitals_mo.conj(), bloch_orbitals_mo, optimize=True
916912
)
917-
weighting_function = weighting_function
918913
else:
919914
raise ValueError(f"Unknown value for weighting function {kmeans_weighting_function}")
920915
interp_indx = kmeans.find_interpolating_points(

0 commit comments

Comments
 (0)