-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delayed Phase Correction #397
base: main
Are you sure you want to change the base?
Changes from 1 commit
c81eb40
5eb3747
8c9d539
1cd55fd
256f588
d218f42
af8ee8f
eb35989
b2e3a92
848e9d7
7690afa
d334f58
267c2b1
f58a738
3b3f028
e6c3348
f45ac80
cad2a04
c02c8ed
0608ae9
e8d4794
b8423cc
995ed9d
6a3bafa
dac77bb
60f64ca
4291548
245f55c
a0652f0
aaeb22f
4b48b48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,10 @@ class TableauEncoder { | |
TableauEncoder() = default; | ||
TableauEncoder(const std::size_t nQubits, const std::size_t tableauSize, | ||
const std::size_t timestepLimit, | ||
std::shared_ptr<logicbase::LogicBlock> logicBlock) | ||
std::shared_ptr<logicbase::LogicBlock> logicBlock, | ||
bool ignorePhase=false) | ||
: N(nQubits), S(tableauSize), T(timestepLimit), | ||
lb(std::move(logicBlock)) {} | ||
lb(std::move(logicBlock)), ignoreR(ignorePhase) {} | ||
|
||
struct Variables { | ||
// variables for the X parts of the tableaus | ||
|
@@ -76,5 +77,7 @@ class TableauEncoder { | |
|
||
// the logic block to use | ||
std::shared_ptr<logicbase::LogicBlock> lb{}; | ||
|
||
bool ignoreR = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am adding this here another time just to be sure: Consistent naming of this option throughout the library would greatly benefit clarity. |
||
}; | ||
} // namespace cs::encoding |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,12 +49,18 @@ void encoding::MultiGateEncoder::assertGateConstraints() { | |
xorHelpers = logicbase::LogicMatrix{T}; | ||
for (std::size_t t = 0U; t < T; ++t) { | ||
TRACE() << "Asserting gate constraints at time " << t; | ||
rChanges = tvars->r[t]; | ||
splitXorR(tvars->r[t], t); | ||
if(!ignoreRChanges){ | ||
rChanges = tvars->r[t]; | ||
splitXorR(tvars->r[t], t); | ||
} | ||
assertSingleQubitGateConstraints(t); | ||
assertTwoQubitGateConstraints(t); | ||
TRACE() << "Asserting r changes at time " << t; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This logging message should be moved to the underlying if |
||
lb->assertFormula(tvars->r[t + 1] == xorHelpers[t].back()); | ||
|
||
if(!ignoreRChanges){ | ||
lb->assertFormula(tvars->r[t + 1] == xorHelpers[t].back()); | ||
} | ||
|
||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads-up: I personally despise
Utils
files, so please feel free to disagree on this, but I do not think the functionality here should be in a separate file.All of this can simply go into the
GateSet
class/file. TheisPauli
method can even be used there to simplify some if condition.