Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
doichanj committed May 13, 2024
1 parent 9c53786 commit 630e800
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/simulators/stabilizer/clifford.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ bool Clifford::measure_and_update(const uint64_t qubit,
accumZ ^= (accumZ << 16);
accumX ^= (accumX << 32);
accumZ ^= (accumZ << 32);
//store for next iteration
// store for next iteration
accumX_prev = ((accumX >> 63) & 1) != 0;
accumZ_prev = ((accumZ >> 63) & 1) != 0;
//correct for this iteration
// correct for this iteration
accumX ^= sX;
accumZ ^= sZ;
accumX &= destabilizer_mask;
Expand Down
28 changes: 14 additions & 14 deletions test/terra/backends/aer_simulator/test_measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,32 +289,32 @@ def test_measure_stablizer_deterministic(self, method, device):
"""Test stabilizer measure for deterministic case"""
backend = self.backend(method=method, device=device)
shots = 10000
qc = QuantumCircuit(5,1)
qc.h([2,4])
qc.cx(2,0)
qc = QuantumCircuit(5, 1)
qc.h([2, 4])
qc.cx(2, 0)
qc.s(0)
qc.cx(4,2)
qc.cx(4, 2)
qc.h(0)
qc.cx(2,3)
qc.cx(2, 3)
qc.s(4)
qc.cx(1,0)
qc.h([3,4])
qc.cx(3,2)
qc.cx(1, 0)
qc.h([3, 4])
qc.cx(3, 2)
qc.h(3)
qc.cx(0,3)
qc.cx(3,1)
qc.cx(0, 3)
qc.cx(3, 1)
qc.s(0)
qc.s(1)
qc.h(0)
qc.s(0)
qc.cx(4,0)
qc.cx(0,1)
qc.measure(1,0)
qc.cx(4, 0)
qc.cx(0, 1)
qc.measure(1, 0)
result = backend.run(qc, shots=shots).result()
counts = result.get_counts()
self.assertSuccess(result)

self.assertDictEqual(counts, {'1': shots})
self.assertDictEqual(counts, {"1": shots})

# ---------------------------------------------------------------------
# Test MPS algorithms for measure
Expand Down

0 comments on commit 630e800

Please sign in to comment.