Skip to content
Draft
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 .github/workflows/ci-nightly-cirq-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# For testing, this workflow can be invoked manually from the GitHub page at
# https://github.com/tensorflow/quantum/actions/workflows/ci-nightly-cirq-test.yaml
# Clicking the "Run workflow" button there will present a form interface with
# options for overridding some of the parameters for the run.
# options for overriding some of the parameters for the run.

# yamllint disable rule:line-length

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
# 2024-11-30 [mhucka] temporarily turning off leak-tests because it produces
# false positives on GH that we can't immediately address. TODO: if updating
# TFQ to use Clang and the latest TF does not resolve this, find a way to
# skip the handful of failing tests and renable the rest of the msan tests.
# skip the handful of failing tests and re-enable the rest of the msan tests.
#
# leak-tests:
# name: Memory Leak tests
Expand Down
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fi

write_bazelrc ""

# The following supressions are for warnings coming from external dependencies.
# The following suppressions are for warnings coming from external dependencies.
# They're most likely inconsequential or false positives. Since we can't fix
# them, we suppress the warnings to reduce noise. Note: single quotes are needed
# for the first two so that the $ anchors are preserved in the .bazelrc file.
Expand Down
2 changes: 1 addition & 1 deletion release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ into the upstream repository before proceeding further.

This will update the dependency versions in the file `requirements.txt` to
the latest versions based on `requirements.in`. If this process fails, you
may have to iterate on adjusting the contraints in `requirements.in`
may have to iterate on adjusting the constraints in `requirements.in`
followed by running `generate_requirements.sh` again until it succeeds.

3. If any changes were made to `requirements.in`, check the requirements listed
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/batch_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def on_job_result(self, job, result):
self._ones[job_id] += parities[1]

def collect(self, sampler):
"""Synchronus collect."""
"""Synchronous collect."""
# See #562, this is a workaround to an event loop issue in the tutorials
# see also:
# https://stackoverflow.com/questions/55409641/asyncio-run-cannot-be-called-from-a-running-event-loop
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/cirq_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def cirq_sample(programs, symbol_names, symbol_values, num_samples):
symbol labeled 'b' and 1 into the symbol labeled 'c'. Then it would
draw 100 samples from the circuit.

Note: In the case of circuits with varying size, all nonexistant
Note: In the case of circuits with varying size, all nonexistent
samples for a particular circuit are padded with -2.

Args:
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/cirq_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def test_simulate_state_output_padding(self, op_and_sim, all_n_qubits):
for circuit in circuit_batch:
result = sim.simulate(circuit)

# density matricies should be zero everywhere except for the
# density matrices should be zero everywhere except for the
# top left corner
if isinstance(result, cirq.DensityMatrixTrialResult):
dm = result.final_density_matrix
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/math_ops/fidelity_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def fidelity(programs, symbol_names, symbol_values, other_programs):
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
other_programs: `tf.Tensor` of strings with shape [batch_size, n_others]
containing the string representations of the circuits with which to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_inner_product_grad_inputs(self):
with self.assertRaisesRegex(tf.errors.InvalidArgumentError,
'not found in reference circuit'):
# other_programs tensor has the right type but operates on
# qubits that the reference ciruit doesn't have.
# qubits that the reference circuit doesn't have.
new_qubits = [cirq.GridQubit(5, 5), cirq.GridQubit(9, 9)]
new_circuits, _ = util.random_circuit_resolver_batch(
new_qubits, batch_size)
Expand All @@ -134,7 +134,7 @@ def test_inner_product_grad_inputs(self):
with self.assertRaisesRegex(tf.errors.InvalidArgumentError,
'not found in paired circuit'):
# other_programs tensor has the right type but operates on
# qubits that the reference ciruit doesn't have.
# qubits that the reference circuit doesn't have.
new_qubits = cirq.GridQubit.rect(1, n_qubits - 1)
new_circuits, _ = util.random_circuit_resolver_batch(
new_qubits, batch_size)
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_quantum/core/ops/math_ops/inner_product_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _inner_product_grad(programs, symbol_names, symbol_values, other_programs,
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
other_programs: `tf.Tensor` of strings with shape [batch_size, n_others]
containing the string representations of the circuits with which to
Expand Down Expand Up @@ -122,7 +122,7 @@ def inner_product(programs, symbol_names, symbol_values, other_programs):
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
other_programs: `tf.Tensor` of strings with shape [batch_size, n_others]
containing the string representations of the circuits with which to
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_quantum/core/ops/math_ops/inner_product_op_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def test_inner_product_inputs(self):
with self.assertRaisesRegex(tf.errors.InvalidArgumentError,
'not found in reference circuit'):
# other_programs tensor has the right type but operates on
# qubits that the reference ciruit doesn't have.
# qubits that the reference circuit doesn't have.
new_qubits = [cirq.GridQubit(5, 5), cirq.GridQubit(9, 9)]
new_circuits, _ = util.random_circuit_resolver_batch(
new_qubits, batch_size)
Expand All @@ -127,7 +127,7 @@ def test_inner_product_inputs(self):
with self.assertRaisesRegex(tf.errors.InvalidArgumentError,
'not found in paired circuit'):
# other_programs tensor has the right type but operates on
# qubits that the reference ciruit doesn't have.
# qubits that the reference circuit doesn't have.
new_qubits = cirq.GridQubit.rect(1, n_qubits - 1)
new_circuits, _ = util.random_circuit_resolver_batch(
new_qubits, batch_size)
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_quantum/core/ops/math_ops/simulate_mps.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def mps_1d_expectation(programs,
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
pauli_sums: `tf.Tensor` of strings with shape [batch_size, n_ops]
containing the string representation of the operators that will
Expand Down Expand Up @@ -127,7 +127,7 @@ def mps_1d_sampled_expectation(programs,
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
pauli_sums: `tf.Tensor` of strings with shape [batch_size, n_ops]
containing the string representation of the operators that will
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/noise/noisy_expectation_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def expectation(programs, symbol_names, symbol_values, pauli_sums, num_samples):
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
pauli_sums: `tf.Tensor` of strings with shape [batch_size, n_ops]
containing the string representation of the operators that will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Module for high performance noisy circuit sampled epxectation ops."""
"""Module for high performance noisy circuit sampled expectation ops."""
import os
import tensorflow as tf
from tensorflow_quantum.core.ops.load_module import load_module
Expand Down Expand Up @@ -74,7 +74,7 @@ def sampled_expectation(programs, symbol_names, symbol_values, pauli_sums,
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
pauli_sums: `tf.Tensor` of strings with shape [batch_size, n_ops]
containing the string representation of the operators that will
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/noise/tfq_noisy_samples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class TfqNoisySamplesOp : public tensorflow::OpKernel {

// Simulate programs one by one. Parallelizing over state vectors
// we no longer parallelize over circuits. Each time we encounter a
// a larger circuit we will grow the Statevector as nescessary.
// a larger circuit we will grow the Statevector as necessary.
for (size_t i = 0; i < ncircuits.size(); i++) {
int nq = num_qubits[i];

Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/parse_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Status ParseProto(const std::string& text, T* proto) {

return Status(
static_cast<tensorflow::errors::Code>(absl::StatusCode::kInvalidArgument),
"Unparseable proto: " + text);
"Unparsable proto: " + text);
}

} // namespace
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/tfq_adj_grad_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def tfq_adj_grad(programs, symbol_names, symbol_values, pauli_sums, prev_grad):
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
pauli_sums: `tf.Tensor` of strings with shape [batch_size, n_ops]
containing the string representation of the operators that will
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/tfq_calculate_unitary_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class TfqCalculateUnitaryOp : public tensorflow::OpKernel {

// Simulate programs one by one. Parallelizing over state vectors
// we no longer parallelize over circuits. Each time we encounter a
// a larger circuit we will grow the unitary as nescessary.
// a larger circuit we will grow the unitary as necessary.
for (size_t i = 0; i < fused_circuits.size(); i++) {
int nq = num_qubits[i];
UCalculator sim = UCalculator(tfq_for);
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_quantum/core/ops/tfq_ps_util_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def test_moment_preservation(self):
# The non-decomposed moments should be the same.
self.assertEqual(decomposed_programs[0][0], circuit_batch[0][0])
self.assertEqual(decomposed_programs[0][-1], circuit_batch[0][-1])
# Check paralellized decompose gates in Moment[1]~[3].
# Check parallelized decompose gates in Moment[1]~[3].
# The target ops are replaced by the first decomposition gates. It means
# the first Moment has exactly the same number of gate ops.
self.assertEqual(len(decomposed_programs[0][1]),
Expand Down Expand Up @@ -343,7 +343,7 @@ def test_more_complex_moment_preservation(self):
# The non-decomposed moments should be the same.
self.assertEqual(decomposed_programs[0][0], circuit_batch[0][0])
self.assertEqual(decomposed_programs[0][-1], circuit_batch[0][-1])
# Check paralellized decompose gates in Moment[1]~[3].
# Check parallelized decompose gates in Moment[1]~[3].
# The target ops are replaced by the first decomposition gates. It means
# the first Moment has exactly the same number of gate ops.
self.assertEqual(len(decomposed_programs[0][1]),
Expand Down
6 changes: 3 additions & 3 deletions tensorflow_quantum/core/ops/tfq_simulate_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def tfq_simulate_expectation(programs, symbol_names, symbol_values, pauli_sums):
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
pauli_sums: `tf.Tensor` of strings with shape [batch_size, n_ops]
containing the string representation of the operators that will
Expand Down Expand Up @@ -60,7 +60,7 @@ def tfq_simulate_state(programs, symbol_names, symbol_values):
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
Returns:
A `tf.Tensor` containing the final state of each circuit in `programs`.
Expand Down Expand Up @@ -116,7 +116,7 @@ def tfq_simulate_sampled_expectation(programs, symbol_names, symbol_values,
`programs`.
symbol_values: `tf.Tensor` of real numbers with shape
[batch_size, n_params] specifying parameter values to resolve
into the circuits specificed by programs, following the ordering
into the circuits specified by programs, following the ordering
dictated by `symbol_names`.
pauli_sums: `tf.Tensor` of strings with shape [batch_size, n_ops]
containing the string representation of the operators that will
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/tfq_simulate_samples_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class TfqSimulateSamplesOp : public tensorflow::OpKernel {

// Simulate programs one by one. Parallelizing over state vectors
// we no longer parallelize over circuits. Each time we encounter a
// a larger circuit we will grow the Statevector as nescessary.
// a larger circuit we will grow the Statevector as necessary.
for (size_t i = 0; i < fused_circuits.size(); i++) {
int nq = num_qubits[i];

Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/tfq_simulate_state_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class TfqSimulateStateOp : public tensorflow::OpKernel {

// Simulate programs one by one. Parallelizing over state vectors
// we no longer parallelize over circuits. Each time we encounter a
// a larger circuit we will grow the Statevector as nescessary.
// a larger circuit we will grow the Statevector as necessary.
for (size_t i = 0; i < fused_circuits.size(); i++) {
int nq = num_qubits[i];

Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/tfq_utility_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_append_input_checking(self):
def test_append_circuit(self, max_n_bits, symbols, n_circuits):
"""Generate a bunch of circuits of different lengths acting on different
numbers of qubits and append them using our op, checking that results
are consistant with the native cirq method.
are consistent with the native cirq method.
"""
base_circuits = []
circuits_to_append = []
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/serialize/op_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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.
"""op_serializer.py adapated from Cirq release 0.9.0"""
"""op_serializer.py adapted from Cirq release 0.9.0"""

from typing import List
import cirq
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/serialize/op_serializer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def test_to_proto_no_getattr(self, q):

@parameterized.parameters([cirq.GridQubit(1, 2), cirq.LineQubit(4)])
def test_to_proto_not_required_ok(self, q):
"""Test non require arg absense succeeds."""
"""Test non require arg absence succeeds."""
serializer = op_serializer.GateOpSerializer(
gate_type=GateWithProperty,
serialized_gate_id='my_gate',
Expand Down
6 changes: 3 additions & 3 deletions tensorflow_quantum/core/src/circuit_parser_qsim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ inline Status ParseProtoControls(const Operation& op,

if (control_toks.size() != control_v_toks.size()) {
return Status(absl::StatusCode::kInvalidArgument,
"Mistmatched number of control qubits and control values.");
"Mismatched number of control qubits and control values.");
}
if (control_toks.empty()) {
return ::tensorflow::Status();
Expand All @@ -121,7 +121,7 @@ inline Status ParseProtoControls(const Operation& op,
valid = absl::SimpleAtoi(tok, &tmp);
if (!valid) {
return Status(absl::StatusCode::kInvalidArgument,
"Unparseable control value: " + std::string(tok));
"Unparsable control value: " + std::string(tok));
}
control_values->push_back(tmp);
}
Expand All @@ -146,7 +146,7 @@ inline Status OptionalInsertControls(const Operation& op,
}

// series of fixed signature gate builders.
// there is no need to error check for unparseable symbols
// there is no need to error check for unparsable symbols
// or proto args not being present. Those errors are caught
// upstream.

Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/src/circuit_parser_qsim.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ tensorflow::Status QsimCircuitFromProgram(
const absl::flat_hash_map<std::string, std::pair<int, float>>& param_map,
const int num_qubits, qsim::Circuit<qsim::Cirq::GateCirq<float>>* circuit,
std::vector<qsim::GateFused<qsim::Cirq::GateCirq<float>>>* fused_circuit,
std::vector<GateMetaData>* metdata = nullptr);
std::vector<GateMetaData>* metadata = nullptr);

// parse a serialized Cirq program into a qsim representation.
// ingests a Cirq Circuit proto and produces a resolved Noisy qsim Circuit.
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_quantum/core/src/circuit_parser_qsim_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ TEST(QsimCircuitParserTest, InvalidControlValues) {
ASSERT_EQ(QsimCircuitFromProgram(program_proto, empty_map, 3, &test_circuit,
&fused_circuit, &metadata),
tensorflow::Status(absl::StatusCode::kInvalidArgument,
"Unparseable control value: junk"));
"Unparsable control value: junk"));
}

TEST(QsimCircuitParserTest, MismatchControlNum) {
Expand Down Expand Up @@ -1158,7 +1158,7 @@ TEST(QsimCircuitParserTest, MismatchControlNum) {
&fused_circuit, &metadata),
tensorflow::Status(
absl::StatusCode::kInvalidArgument,
"Mistmatched number of control qubits and control values."));
"Mismatched number of control qubits and control values."));
}

TEST(QsimCircuitParserTest, EmptyTest) {
Expand Down
Loading
Loading