Skip to content

Commit

Permalink
Add bloq counts for rotations. (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
fdmalone authored Oct 6, 2023
1 parent 9021b71 commit a73de04
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit a73de04

Please sign in to comment.