Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ allowed-redefined-builtins=
callbacks=cb_,
_cb

# A regular expression matching the name of dummy variables (i.e. expected to
# A regular expression matching the name of placeholder variables (i.e. expected to
# not be used).
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_

Expand Down
2 changes: 1 addition & 1 deletion dev_tools/requirements/create-env-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ cd "${repo_dir}"

mkdir -p dev_tools/requirements/envs dev_tools/requirements/max_compat

# ~~~~ Generate normal requirements files ~~~~
# ~~~~ Generate basic requirements files ~~~~

uv pip compile "$@" \
-o dev_tools/requirements/envs/dev.env.txt \
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/binary_code_transforms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"## Symbolic binary functions\n",
"\n",
"The non-linear binary functions for the components of the decoder are here modeled by the $\\text{BinaryPolynomial}$ class in openfermion.ops.\n",
"For initialization we can conveniently use strings ('w0 w1 + w1 +1' for the binary function $\\boldsymbol{\\omega} \\to \\omega_0 \\omega_1 + \\omega_1 + 1 \\;\\text{mod 2}$), the native data structure or symbolic addition and multiplication."
"For initialization we can conveniently use strings ('w0 w1 + w1 +1' for the binary function $\\boldsymbol{\\omega} \\to \\omega_0 \\omega_1 + \\omega_1 + 1 \\;\\text{mod 2}$), the built-in data structure or symbolic addition and multiplication."
]
},
{
Expand All @@ -134,7 +134,7 @@
"print(BinaryPolynomial('w0') * BinaryPolynomial('w1 + 1') + BinaryPolynomial('1'))\n",
"print(BinaryPolynomial([(1, 0), (1, ), ('one', )]))\n",
"\n",
"print('The native data type structure can be seen here:')\n",
"print('The built-in data type structure can be seen here:')\n",
"print(binary_1.terms)\n",
"print('We can always evaluate the expression for instance by the vector (w0, w1, w2) = (1, 0, 0):',\n",
" binary_1.evaluate('100'))"
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/circuits_1_basis_change.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
"id": "e524a8c4bf7b"
},
"source": [
"Thus, we see that the circuit correctly effects the intended evolution. We can now use Cirq's compiler to output the circuit using gates native to near-term devices, and then optimize those circuits. We'll output in QASM 2.0 just to demonstrate that functionality."
"Thus, we see that the circuit correctly effects the intended evolution. We can now use Cirq's compiler to output the circuit using gates built-in to near-term devices, and then optimize those circuits. We'll output in QASM 2.0 just to demonstrate that functionality."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion rtd_docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#
source_suffix = {'.rst': 'restructuredtext', '.md': 'markdown'}

# The master toctree document.
# The main toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/circuits/primitives/swap_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def swap_network(
representing either qubits or fermionic modes, and p_qubit and
q_qubit are the qubits which are currently storing those modes.
fermionic: If True, use fermionic swaps under the JWT (that is, swap
fermionic modes instead of qubits). If False, use normal qubit
fermionic modes instead of qubits). If False, use ordinary qubit
swaps.
offset: If True, then qubit 0 will participate in odd-numbered layers
instead of even-numbered layers.
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/ops/operators/binary_polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BinaryPolynomial:

For initialization, the preferred data types is either a string of the
multinomial, where each variable and constant is to be well separated by
a whitespace, or in its native form of tuples,
a whitespace, or in its built-in form of tuples,
1 + w1 w2 + w0 w1 is represented as [(_SYMBOLIC_ONE,),(1,2),(0,1)]

After initialization,BinaryPolynomial terms can be manipulated with the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def test_kpoint_isdf_symmetries():
assert np.allclose(kpts[ik_prime] - kpts[ik_prime_minus_q] - kpts[iq], delta_Gs[iq][iGsr])
# (pk qk-Q | rk'-Q sk') = (q k-Q p k | sk' rk'-Q)*
ik_prime_minus_q = momentum_map[iq, ik_prime]
# uncomment to check normal eris
# uncomment to check standard eris
# kpt_pqrs = [ik, ik_minus_q, ik_prime_minus_q, ik_prime]
# eri_pqrs = build_eri(mf, kpt_pqrs)
# kpt_pqrs = [ik, ik_minus_q, ik_prime_minus_q, ik_prime]
Expand Down Expand Up @@ -435,7 +435,7 @@ def test_kpoint_isdf_symmetries():
)
assert np.allclose(zeta_ref, zeta_test.conj())
# (pk qk-Q | rk'-Q sk') = (rk'-Q s k'| pk qk-Q)
# uncomment to check normal eris
# uncomment to check standard eris
# kpt_pqrs = [ik_prime_minus_q, ik_prime, ik, ik_minus_q]
# eri_rspq = build_eri(mf, kpt_pqrs).transpose((2, 3, 0, 1))
# assert np.allclose(eri_pqrs, eri_rspq)
Expand All @@ -444,7 +444,7 @@ def test_kpoint_isdf_symmetries():
zeta_test = kpt_thc.zeta[minus_iq][iGsr_comp, iGpq_comp]
assert np.allclose(zeta_ref, zeta_test.T)
# (pk qk-Q | rk'-Q sk') = (sk' r k'-Q| qk-Q pk)
# uncomment to check normal eris
# uncomment to check standard eris
# kpt_pqrs = [ik_prime, ik_prime_minus_q, ik_minus_q, ik]
# eri_srqp = build_eri(mf, kpt_pqrs).transpose((3, 2, 1, 0))
# assert np.allclose(eri_pqrs, eri_srqp.conj())
Expand Down
4 changes: 2 additions & 2 deletions src/openfermion/resource_estimates/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def QR2(L1: int, L2: int, M1: int) -> Tuple[int, int, int]:

k1_opt, k2_opt = 0, 0
val_opt = 1e50
# Doing this as a stupid loop for now, worth refactoring but cost is quick
# Doing this as a suboptimal loop for now, worth refactoring but cost is quick
# Biggest concern is if k1 / k2 range is not large enough!
for k1 in range(1, 17):
for k2 in range(1, 17):
Expand Down Expand Up @@ -109,7 +109,7 @@ def QI2(L1: int, L2: int) -> Tuple[int, int, int]:

k1_opt, k2_opt = 0, 0
val_opt = 1e50
# Doing this as a stupid loop for now, worth refactoring but cost is quick
# Doing this as a suboptimal loop for now, worth refactoring but cost is quick
# Biggest concern is if k1 / k2 range is not large enough!
for k1 in range(1, 17):
for k2 in range(1, 17):
Expand Down
6 changes: 3 additions & 3 deletions src/openfermion/transforms/repconversions/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_quadratic_hamiltonian(
coefficient = fermion_operator.terms[term]
# Ignore this term if the coefficient is zero
if abs(coefficient) < EQ_TOLERANCE:
# not testable because normal_ordered kills
# not testable because normal_ordered eliminates
# fermion terms lower than EQ_TOLERANCE
continue # pragma: no cover

Expand Down Expand Up @@ -198,7 +198,7 @@ def get_diagonal_coulomb_hamiltonian(
for term, coefficient in fermion_operator.terms.items():
# Ignore this term if the coefficient is zero
if abs(coefficient) < EQ_TOLERANCE:
# not testable because normal_ordered kills
# not testable because normal_ordered eliminates
# fermion terms lower than EQ_TOLERANCE
continue # pragma: no cover

Expand Down Expand Up @@ -284,7 +284,7 @@ def get_interaction_operator(fermion_operator, n_qubits=None):
coefficient = fermion_operator.terms[term]
# Ignore this term if the coefficient is zero
if abs(coefficient) < EQ_TOLERANCE:
# not testable because normal_ordered kills
# not testable because normal_ordered eliminates
# fermion terms lower than EQ_TOLERANCE
continue # pragma: no cover

Expand Down
Loading