Skip to content

Commit

Permalink
Apply suggestions from CommonTypos checker (#817)
Browse files Browse the repository at this point in the history
No change in code function.
  • Loading branch information
pavoljuhas committed May 1, 2023
1 parent f8305ee commit 7c34b68
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docker/README.md
Expand Up @@ -48,7 +48,7 @@ docker run -it openfermion_docker

With this command the terminal enters a new environment which emulates Ubuntu with
OpenFermion and accessories installed. To transfer files from somewhere on the disk to the Docker
container, first run `docker ps` in a seperate terminal from the one running
container, first run `docker ps` in a separate terminal from the one running
Docker. This returns a list of running containers, e.g.:

```
Expand Down
4 changes: 2 additions & 2 deletions docs/fqe/tutorials/diagonal_coulomb_evolution.ipynb
Expand Up @@ -271,7 +271,7 @@
"sz = 0\n",
"fqe_wfn = fqe.Wavefunction([[n_elec, sz, norbs]])\n",
"fqe_wfn.set_wfn(strategy='random')\n",
"inital_coeffs = fqe_wfn.get_coeff((n_elec, sz)).copy()\n",
"initial_coeffs = fqe_wfn.get_coeff((n_elec, sz)).copy()\n",
"print(\"Random initial wavefunction\")\n",
"fqe_wfn.print_wfn()"
]
Expand Down Expand Up @@ -363,7 +363,7 @@
"source": [
"fqe_wfn = fqe.Wavefunction([[n_elec, sz, norbs]])\n",
"fqe_wfn.set_wfn(strategy='from_data',\n",
" raw_data={(n_elec, sz): inital_coeffs})\n",
" raw_data={(n_elec, sz): initial_coeffs})\n",
"for term, coeff in diagonal_coulomb.terms.items():\n",
" op = of.FermionOperator(term, coefficient=coeff)\n",
" fqe_wfn = fqe_wfn.time_evolve(1, op)\n",
Expand Down
Expand Up @@ -137,7 +137,7 @@
"source": [
"## Application of one- and two-body fermionic gates\n",
"\n",
"The API for time propogation can be invoked through the fqe namespace or the wavefunction object"
"The API for time propagation can be invoked through the fqe namespace or the wavefunction object"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/intro_to_openfermion.ipynb
Expand Up @@ -646,7 +646,7 @@
"id": "0aa06eb285b9"
},
"source": [
"The geometry data needed to generate MolecularData can also be retreived from the PubChem online database by inputting the molecule's name."
"The geometry data needed to generate MolecularData can also be retrieved from the PubChem online database by inputting the molecule's name."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/circuits/primitives/ffft.py
Expand Up @@ -187,7 +187,7 @@ def fourier_transform_matrix(size):
qubits: Sequence of qubits that the FFFT circuit will be generated for.
This sequence represents a sequence of consecutive creation
operators under big-endian encoded JWT representation. The indices
assignment is significant since it it used to define the FFFT
assignment is significant since it used to define the FFFT
operation itself. The input sequence is assumed to have nearest
neighbourhood connectivity.
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/contrib/representability/_namedtensor.py
Expand Up @@ -59,7 +59,7 @@ def __getitem__(self, indices):

def __call__(self, *indices):
"""
Index into the the data by passing through the basis first
Index into the data by passing through the basis first
:param indices: indices for the rev_bas
:return: element of the data
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/linalg/givens_rotations.py
Expand Up @@ -112,7 +112,7 @@ def givens_rotate(operator, givens_rotation, i, j, which='row'):
def double_givens_rotate(operator, givens_rotation, i, j, which='row'):
"""Apply a double Givens rotation.
Applies a Givens rotation to coordinates i and j and the the conjugate
Applies a Givens rotation to coordinates i and j and the conjugate
Givens rotation to coordinates n + i and n + j, where
n = dim(operator) / 2. dim(operator) must be even.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/linalg/linear_qubit_operator.py
Expand Up @@ -192,7 +192,7 @@ def _matvec(self, x):


def apply_operator(args):
"""Helper funtion to apply opeartor to a vector."""
"""Helper function to apply operator to a vector."""
operator, vec = args
return operator * vec

Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/ops/representations/doci_hamiltonian.py
Expand Up @@ -380,7 +380,7 @@ def get_projected_integrals(self):
)
)
but this method attemps to create integrals that conform to the
but this method attempts to create integrals that conform to the
same symmetries as a physical electronic structure Hamiltonian would,
with inevitable loss of information due to the ambiguity above.
Expand Down
4 changes: 2 additions & 2 deletions src/openfermion/ops/representations/polynomial_tensor.py
Expand Up @@ -28,7 +28,7 @@ class PolynomialTensorError(Exception):


def general_basis_change(general_tensor, rotation_matrix, key):
r"""Change the basis of an general interaction tensor.
r"""Change the basis of a general interaction tensor.
M'^{p_1p_2...p_n} = R^{p_1}_{a_1} R^{p_2}_{a_2} ...
R^{p_n}_{a_n} M^{a_1a_2...a_n} R^{p_n}_{a_n}^T ...
Expand Down Expand Up @@ -105,7 +105,7 @@ class PolynomialTensor(object):
n_qubits x n_qubits matrix. Higher order terms would be described with
tensors of higher dimension. Note that each tensor must have an even
number of dimensions, since parity is conserved.
Much of the functionality of this class is redudant with FermionOperator
Much of the functionality of this class is redundant with FermionOperator
but enables much more efficient numerical computations in many cases,
such as basis rotations.
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/resource_estimates/README.md
Expand Up @@ -120,7 +120,7 @@ Which generate similar outputs, e.g. the above would generate tables in `double_
More fine-grained control is given by subroutines that compute the factorization, the lambda values, and the cost estimates. For example, considering the double factorization, we could have

```python
factorized_eris, df_factors, _, _ = df.factorize(mf._eri, cutoff_threshhold)
factorized_eris, df_factors, _, _ = df.factorize(mf._eri, cutoff_threshold)
df_lambda = df.compute_lambda(mf, df_factors)
_, number_toffolis, num_logical_qubits = df.compute_cost(num_spin_orbitals, df_lambda, *args)
```
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/resource_estimates/thc/factorize_thc.py
Expand Up @@ -21,7 +21,7 @@ def thc_via_cp3(eri_full,
"""
THC-CP3 performs an SVD decomposition of the eri matrix followed by a CP
decomposition via pybtas. The CP decomposition is assumes the tensor is
symmetric in in the first two indices corresponding to a reshaped
symmetric in the first two indices corresponding to a reshaped
(and rescaled by the singular value) singular vector.
Args:
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/resource_estimates/thc/spacetime.py
Expand Up @@ -199,7 +199,7 @@ def qubit_vs_toffoli(lam,
# This is increasing the running number of permanent ancillas by 2 for the
# ν=M+1 flag qubit and the success flag qubit.
perm = perm + 2
# The number of temporary qubits used in this computation is the the same
# The number of temporary qubits used in this computation is the same
# as the number of Toffolis plus one.
qu2 = perm + nM**2 + nM
# The Toffoli cost of computing the contiguous register.
Expand Down
Expand Up @@ -31,7 +31,7 @@ def chemist_ordered(fermion_operator):
TODO: This routine can be made more efficient.
Args:
fermion_operator (FermionOperator): a fermion operator guarenteed to
fermion_operator (FermionOperator): a fermion operator guaranteed to
have number conserving one- and two-body fermion terms only.
Returns:
chemist_ordered_operator (FermionOperator): the input operator
Expand Down
Expand Up @@ -9,7 +9,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Useful miscelaneous functions to transform QubitOperators
"""Useful miscellaneous functions to transform QubitOperators
"""

import numpy
Expand Down
Expand Up @@ -38,7 +38,7 @@ def check_commuting_stabilizers(stabilizer_list, msg, thres=EQ_TOLERANCE):
If two stabilizers anti-commute their product
will have an imaginary coefficient.
This function checks the list of stabilizers (QubitOperator)
and raises and error if a complex number is found in
and raises an error if a complex number is found in
any of the coefficients.
Args:
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/transforms/repconversions/weyl_ordering.py
Expand Up @@ -130,7 +130,7 @@ def symmetric_ordering(operator, ignore_coeff=True, ignore_identity=True):
the returned operator is always Hermitian.
If set to False, then instead the coefficients are taken into
account; S(q^m p^n) = a S(q^m p^n). In this case, if
a is a complex coefficient, it is not guaranteed that the
a is a complex coefficient, it is not guaranteed that
the returned operator will be Hermitian.
ignore_identity (bool): By default, identity terms are ignore;
S(I) = 0. If set to False, then instead S(I) = I.
Expand Down

0 comments on commit 7c34b68

Please sign in to comment.