Skip to content

Fix #924: remove self-assignments#1059

Merged
mhucka merged 2 commits intomasterfrom
mh-fix-924
Jun 3, 2025
Merged

Fix #924: remove self-assignments#1059
mhucka merged 2 commits intomasterfrom
mh-fix-924

Conversation

@mhucka
Copy link
Copy Markdown
Contributor

@mhucka mhucka commented Jun 2, 2025

In lines 587-589, a variable is getting assigned to itself, which is probably an error:

    else:
        delta_gs = [g_vectors] * num_kpts
        g_mapping = g_mapping

Around lines 912-917, the same thing happens with another variable:

    elif kmeans_weighting_function == "sum_squares":
        # w(r) = sum_{i} |phi_{ki}(r)|
        weighting_function = np.einsum(
            "kRi,kRi->R", bloch_orbitals_mo.conj(), bloch_orbitals_mo, optimize=True
        )
        weighting_function = weighting_function

Resolves issue #924.

In lines 587-589, a variable is getting assigned to itself, which is probably an error:

```python
    else:
        delta_gs = [g_vectors] * num_kpts
        g_mapping = g_mapping
```

Around lines 912-917, the same thing happens with another variable:

```python
    elif kmeans_weighting_function == "sum_squares":
        # w(r) = sum_{i} |phi_{ki}(r)|
        weighting_function = np.einsum(
            "kRi,kRi->R", bloch_orbitals_mo.conj(), bloch_orbitals_mo, optimize=True
        )
        weighting_function = weighting_function
```
@fdmalone fdmalone self-requested a review June 2, 2025 22:09
@mhucka mhucka added this pull request to the merge queue Jun 3, 2025
Merged via the queue into master with commit 28ebc2a Jun 3, 2025
29 checks passed
@mhucka mhucka deleted the mh-fix-924 branch June 3, 2025 20:56
mhucka added a commit to mhucka/OpenFermion that referenced this pull request Sep 25, 2025
In lines 587-589, a variable is getting assigned to itself, which is
probably an error:

```python
    else:
        delta_gs = [g_vectors] * num_kpts
        g_mapping = g_mapping
```

Around lines 912-917, the same thing happens with another variable:

```python
    elif kmeans_weighting_function == "sum_squares":
        # w(r) = sum_{i} |phi_{ki}(r)|
        weighting_function = np.einsum(
            "kRi,kRi->R", bloch_orbitals_mo.conj(), bloch_orbitals_mo, optimize=True
        )
        weighting_function = weighting_function
```

Resolves issue quantumlib#924.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants