-
Notifications
You must be signed in to change notification settings - Fork 47
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
Feature/hardcode c3x, c4x decompositions #134
Conversation
tket/src/Circuit/CircPool.cpp
Outdated
return *C; | ||
} | ||
|
||
const Circuit &RC3X_normal_decomp() { |
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.
This function is only used in this file so should be static
.
tket/src/Circuit/CircPool.cpp
Outdated
return *C; | ||
} | ||
|
||
const Circuit &RC3X_normal_decomp() { |
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.
Can you add a comment describing what this returns? It isn't obvious from the name.
tket/src/Circuit/CircPool.cpp
Outdated
return *C; | ||
} | ||
|
||
const Circuit &C3SX_normal_decomp() { |
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.
Similarly for this function:
- make
static
; - add comment describing what it does.
tket/src/Circuit/CircPool.hpp
Outdated
/** Equivalent to CCCX, using 14 CX */ | ||
const Circuit &C3X_normal_decomp(); | ||
|
||
/** Equivalent to CCCCX, using 30 CX */ |
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.
By my calculation this should be 36:
CU1_using_CX
: 2
RC3X_normal_decomp
: 6
C3SX_normal_decomp
: 7 x CU1_using_CX
+ 6 = 7 x 2 + 6 = 20
C4X_noemal_decomp
: 2 x CU1_using_CX
+ 2 x RC3X_normal_decomp
+ C3SX_normal_decomp
= 2 x 2 + 2 x 6 + 20 = 36
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.
Ahh sorry, I used the CX count in C3X instead of C3SX when counting the number of CXs in C4X.
This improved our CnX decomposition for n <= 10.