Programmable Rotation Gate Array#
from qualtran import Bloq, CompositeBloq, BloqBuilder, Signature, Register
from qualtran import QBit, QInt, QUInt, QAny
from qualtran.drawing import show_bloq, show_call_graph, show_counts_sigma
from typing import *
import numpy as np
import sympy
import cirq
ProgrammableRotationGateArray#
An implementation of ProgrammableRotationGateArrayBase base class
This implementation of the ProgrammableRotationGateArray base class expects
all interleaved_unitaries to act on the rotations_target register.
See docstring of ProgrammableRotationGateArrayBase for more details.
from qualtran.bloqs.rotations import ProgrammableRotationGateArray
Example Instances#
programmable_rotation_gate_array = ProgrammableRotationGateArray(
[1, 2, 3, 4], kappa=2, rotation_gate=cirq.Z
)
Graphical Signature#
from qualtran.drawing import show_bloqs
show_bloqs([programmable_rotation_gate_array],
['`programmable_rotation_gate_array`'])
Call Graph#
from qualtran.resource_counting.generalizers import ignore_split_join
programmable_rotation_gate_array_g, programmable_rotation_gate_array_sigma = programmable_rotation_gate_array.call_graph(max_depth=1, generalizer=ignore_split_join)
show_call_graph(programmable_rotation_gate_array_g)
show_counts_sigma(programmable_rotation_gate_array_sigma)
Counts totals:
CZ**0.125: 1CZ**0.25: 1CZ**0.5: 1QROM((4,), ((),), (2,)): 1QROM((4,), ((),), (2,)): 1QROM((4,), ((),), (2,)): 1