Skip to content

Commit

Permalink
Fix formatting per scripts/format_all.sh
Browse files Browse the repository at this point in the history
Forgot to run the formatter.
  • Loading branch information
mhucka committed Dec 12, 2024
1 parent 363022a commit 5e091ce
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions tensorflow_quantum/core/ops/tfq_adj_grad_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ class TfqAdjointGradientOp : public tensorflow::OpKernel {
cbits |= ((cur_gate.cmask >> k) & 1) << control_loc;
}

for (size_t k = 0; k < gradient_gates[i][j - 1].grad_gates.size(); k++) {
for (size_t k = 0; k < gradient_gates[i][j - 1].grad_gates.size();
k++) {
// Copy sv onto scratch2 in anticipation of non-unitary "gradient
// gate".
ss.Copy(sv, scratch2);
Expand Down Expand Up @@ -358,7 +359,8 @@ class TfqAdjointGradientOp : public tensorflow::OpKernel {
cbits |= ((cur_gate.cmask >> k) & 1) << control_loc;
}

for (size_t k = 0; k < gradient_gates[i][j - 1].grad_gates.size(); k++) {
for (size_t k = 0; k < gradient_gates[i][j - 1].grad_gates.size();
k++) {
// Copy sv onto scratch2 in anticipation of non-unitary "gradient
// gate".
ss.Copy(sv, scratch2);
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_quantum/core/ops/tfq_simulate_state_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ class TfqSimulateStateOp : public tensorflow::OpKernel {

// Parallel copy state vector information from qsim into tensorflow
// tensors.
auto copy_f = [i, nq, &output_tensor, &ss, &sv](
uint64_t start, uint64_t end) {
auto copy_f = [i, nq, &output_tensor, &ss, &sv](uint64_t start,
uint64_t end) {
uint64_t crossover = uint64_t(1) << nq;
uint64_t upper = std::min(end, crossover);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.

#include "gtest/gtest.h"


namespace tfq {
namespace {

Expand Down
6 changes: 4 additions & 2 deletions tensorflow_quantum/core/src/util_qsim.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,11 @@ tensorflow::Status AccumulateFusedCircuits(
tensorflow::Status status = ::tensorflow::Status();
ss.SetAllZeros(dest);

for (std::vector<qsim::GateFused<QsimGate>>::size_type i = 0; i < fused_circuits.size(); i++) {
for (std::vector<qsim::GateFused<QsimGate>>::size_type i = 0;
i < fused_circuits.size(); i++) {
ss.SetStateZero(scratch);
for (std::vector<qsim::GateFused<QsimGate>>::size_type j = 0; j < fused_circuits[i].size(); j++) {
for (std::vector<qsim::GateFused<QsimGate>>::size_type j = 0;
j < fused_circuits[i].size(); j++) {
qsim::ApplyFusedGate(sim, fused_circuits[i][j], scratch);
}
ss.Multiply(coefficients[i], scratch);
Expand Down

0 comments on commit 5e091ce

Please sign in to comment.