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

Add bloq counts for rotations. #377

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion qualtran/bloqs/basic_gates/rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@

import abc
from functools import cached_property
from typing import Dict, Tuple, TYPE_CHECKING
from typing import Dict, Optional, Set, Tuple, TYPE_CHECKING

import numpy as np
from attrs import frozen
from cirq_ft import TComplexity

from qualtran import Bloq, Signature
from qualtran.bloqs.basic_gates.t_gate import TGate

if TYPE_CHECKING:
import cirq
Expand All @@ -46,6 +47,10 @@ def t_complexity(self):
num_t = int(np.ceil(1.149 * np.log2(1.0 / self.eps) + 9.2))
return TComplexity(t=num_t)

def bloq_counts(self, ssa: Optional['SympySymbolAllocator'] = None) -> Set[Tuple[int, Bloq]]:
num_t = int(np.ceil(1.149 * np.log2(1.0 / self.eps) + 9.2))
return {(num_t, TGate())}


@frozen
class Rz(RotationBloq):
Expand Down
Loading