Skip to content

Commit

Permalink
Debug phase-aware QUnitClifford
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Aug 7, 2023
1 parent 16fc6e7 commit 5e537e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/qunitclifford.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,10 @@ class QUnitClifford : public QInterface {
return false;
}

if (this == toCompare.get()) {
return true;
}

return EntangleAll()->ApproxCompare(toCompare->EntangleAll(), error_tol);
}

Expand All @@ -484,18 +488,21 @@ class QUnitClifford : public QInterface {
ThrowIfQubitInvalid(t, std::string("QUnitClifford::Mtrx"));
CliffordShard& shard = shards[t];
shard.unit->Mtrx(mtrx, shard.mapped);
CombinePhaseOffsets(shard.unit);
}
void Phase(complex topLeft, complex bottomRight, bitLenInt t)
{
ThrowIfQubitInvalid(t, std::string("QUnitClifford::Phase"));
CliffordShard& shard = shards[t];
shard.unit->Phase(topLeft, bottomRight, shard.mapped);
CombinePhaseOffsets(shard.unit);
}
void Invert(complex topRight, complex bottomLeft, bitLenInt t)
{
ThrowIfQubitInvalid(t, std::string("QUnitClifford::Invert"));
CliffordShard& shard = shards[t];
shard.unit->Invert(topRight, bottomLeft, shard.mapped);
CombinePhaseOffsets(shard.unit);
}
void MCPhase(const std::vector<bitLenInt>& controls, complex topLeft, complex bottomRight, bitLenInt t)
{
Expand Down

0 comments on commit 5e537e6

Please sign in to comment.