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

Resource Estimator - T states per rotation formula #1218

Closed
bdg221 opened this issue Feb 28, 2024 · 1 comment · Fixed by #1220
Closed

Resource Estimator - T states per rotation formula #1218

bdg221 opened this issue Feb 28, 2024 · 1 comment · Fixed by #1220
Assignees
Labels
bug Something isn't working needs triage

Comments

@bdg221
Copy link

bdg221 commented Feb 28, 2024

Describe the bug

The formula used by the Resource Estimator for number of T states to implement an arbitrary rotation does not match the cited paper.

The formula used by the Resource Estimator is:
T ( \epsilon ) = 0.53 log2 ( 1 / \epsilon ) + 5.3

In practice, the number of T states per rotation is:

                (NUM_TS_PER_ROTATION_A_COEFFICIENT
                    * ((self.rotation_count as f64) / eps_synthesis).log2()
                    + NUM_TS_PER_ROTATION_B_COEFFICIENT)
                    .ceil() as _,

(see logical_counts.rs)
where:

/// A coefficient in Ts per rotation
pub const NUM_TS_PER_ROTATION_A_COEFFICIENT: f64 = 0.53;

/// A coefficient in Ts per rotation
pub const NUM_TS_PER_ROTATION_B_COEFFICIENT: f64 = 5.3;

(see constants.rs)

This information is seen by the user in the "Resource estimates breakdown" section of the estimate report. For example, the double-factorized chemistry sample shows:

The number of T states to implement a rotation with an arbitrary angle is ⌈0.53log2(11,988,044/0.0033333333333333335)+5.3⌉ [arXiv:2203.10064]. For simplicity, we use this formula for all single-qubit arbitrary angle rotations, and do not distinguish between best, worst, and average cases.

However, the linked paper arXiv:2203.10064 does not include this formula.

The table on page 8 of the paper lists a "Mixed fallback" approximation protocol for Clifford+T (T-count) as 0.53 log2 (1/ \epsilon ) + 4.86 and the "Mix fallback" approximation protocol for Clifford+sqrt(T) (T count) as 0.56 log2 (1 /\epsilon) + 5.30.

image

To Reproduce
N/A

Expected behavior

Either the formula should match the paper or an explanation of the formula should be provided.

Screenshots

image

System information
N/A

Additional context
N/A

@bdg221 bdg221 added bug Something isn't working needs triage labels Feb 28, 2024
@msoeken
Copy link
Member

msoeken commented Feb 29, 2024

Thanks for catching this @bdg221. We will change 5.3 to 4.86 to match the mixed fallback mean formula for the Clifford+T gate set.

msoeken added a commit that referenced this issue Feb 29, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 2, 2024
Fixes #1218

---------

Co-authored-by: REDMOND\ivanbaso <ivanbaso@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants