Skip to content

Commit

Permalink
have it your way
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonRayJones committed Feb 27, 2025
1 parent b47afdd commit 3afd29c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/utils/linalg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ qcomp getExpI(qreal x) {
}


int getBit(qindex num, int ind) {
int getBitAt(qindex num, int ind) {
return (num >> ind) & 1;
}

Expand Down Expand Up @@ -308,7 +308,7 @@ qmatrix getPartialTrace(qmatrix in, vector<int> targets) {
// prepare { |0>, I, I, |1>, ... }
vector<qmatrix> matrices(numQubits, getIdentityMatrix(2));
for (size_t t=0; t<numTargs; t++) {
int bit = getBit(v, t);
int bit = getBitAt(v, t);
matrices[targets[t]] = {
{bit? 0.:1.},
{bit? 1.:0.}};
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/linalg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using std::vector;
int getLog2(qindex);
qindex getPow2(int);
qcomp getExpI(qreal);
int getBit(qindex num, int ind);
int getBitAt(qindex num, int ind);

qvector getNormalised(qvector);
qvector getDisceteFourierTransform(qvector);
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ vector<qreal> getAllRefProbsInner(auto& state, vector<int> targets) {
for (size_t i=0; i<out.size(); i++) {

for (size_t j=0; j<outcomes.size(); j++)
outcomes[j] = getBit(i, j);
outcomes[j] = getBitAt(i, j);

out[i] = getReferenceProbability(state, targets, outcomes);
}
Expand Down

0 comments on commit 3afd29c

Please sign in to comment.