Skip to content

tapered binary fix int typing#1356

Open
JdelArco98 wants to merge 1 commit into
quantumlib:mainfrom
JdelArco98:tapered_binary_fix
Open

tapered binary fix int typing#1356
JdelArco98 wants to merge 1 commit into
quantumlib:mainfrom
JdelArco98:tapered_binary_fix

Conversation

@JdelArco98

Copy link
Copy Markdown

on openfermion/transforms/opconversions/binary_code_transform.py line 163 it breaks (with numpy>2.) because (-1) ** updated_parity being updated_parity numpy.count_nonzero(fermionic_indices[:op_idx] < op_tuple[0]) line 146 (therefore a numpy.int) is not instance of int, as it is checked on openfermion/ops/operators/symbolic_operator.py line 124

@google-cla

google-cla Bot commented Jun 10, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the binary_code_transform function in binary_code_transform.py to cast updated_parity to an integer when calculating the parity sign exponent, preventing potential type-related issues. There are no review comments, so I have no feedback to provide.

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.

1 participant