Skip to content
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

Merged
merged 10 commits into from
Dec 10, 2021
Merged

Conversation

yao-cqc
Copy link
Contributor

@yao-cqc yao-cqc commented Nov 24, 2021

This improved our CnX decomposition for n <= 10.

@yao-cqc yao-cqc requested a review from cqc-alec December 9, 2021 10:18
return *C;
}

const Circuit &RC3X_normal_decomp() {
Copy link
Collaborator

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.

return *C;
}

const Circuit &RC3X_normal_decomp() {
Copy link
Collaborator

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.

return *C;
}

const Circuit &C3SX_normal_decomp() {
Copy link
Collaborator

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.

/** Equivalent to CCCX, using 14 CX */
const Circuit &C3X_normal_decomp();

/** Equivalent to CCCCX, using 30 CX */
Copy link
Collaborator

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

Copy link
Contributor Author

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.

@yao-cqc yao-cqc merged commit d70f4f6 into develop Dec 10, 2021
@yao-cqc yao-cqc deleted the feature/hardcode-c3x,-c4x branch December 10, 2021 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants