bloqade.cirq_utils.lowering.Squin
classSquin¶source
bloqade.cirq_utils.lowering.Squin
Bases: lowering.LoweringABC[cirq.Circuit]
Lower a cirq.Circuit object to a squin kernel
class Squin(circuit: cirq.Circuit)Parameters
| Name | Type | Description |
|---|---|---|
circuit | cirq.Circuit |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
circuit | cirq.Circuit | required | |
qreg | ir.SSAValue | field(init=False) | |
qreg_index | dict[cirq.Qid, int] | field(init=False, default_factory=dict) | |
next_qreg_index | int | field(init=False, default=0) | |
two_qubit_paulis | — | ('IX', 'IY', 'IZ', 'XI', 'XX', 'XY', 'XZ', 'YI', 'YX', 'YY', 'YZ', 'ZI', 'ZX', 'ZY', 'ZZ') |
methodlower_qubit_getindex¶source
bloqade.cirq_utils.lowering.Squin.lower_qubit_getindex
Signature
def lower_qubit_getindex(state: lowering.State[cirq.Circuit], qid: cirq.Qid)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
qid | cirq.Qid |
methodlower_qubit_getindices¶source
bloqade.cirq_utils.lowering.Squin.lower_qubit_getindices
Signature
def lower_qubit_getindices(state: lowering.State[cirq.Circuit], qids: tuple[cirq.Qid, ...])Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
qids | tuple[cirq.Qid, ...] |
methodrun¶source
bloqade.cirq_utils.lowering.Squin.run
Signature
def run(stmt: cirq.Circuit, *, source: str | None = None, globals: dict[str, Any] | None = None, file: str | None = None, lineno_offset: int = 0, col_offset: int = 0, compactify: bool = True, register_as_argument: bool = False, register_argument_name: str = 'q') -> ir.RegionParameters
| Name | Type | Default | Description |
|---|---|---|---|
stmt | cirq.Circuit | required | |
source | str | None | None | |
globals | dict[str, Any] | None | None | |
file | str | None | None | |
lineno_offset | int | 0 | |
col_offset | int | 0 | |
compactify | bool | True | |
register_as_argument | bool | False | |
register_argument_name | str | 'q' |
Returns
ir.Region
methodvisit¶source
bloqade.cirq_utils.lowering.Squin.visit
Signature
def visit(state: lowering.State[cirq.Circuit], node: CirqNode) -> lowering.ResultParameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | CirqNode |
Returns
lowering.Result
methodgeneric_visit¶source
bloqade.cirq_utils.lowering.Squin.generic_visit
def generic_visit(state: lowering.State[cirq.Circuit], node: CirqNode)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | CirqNode |
methodlower_literal¶source
bloqade.cirq_utils.lowering.Squin.lower_literal
Signature
def lower_literal(state: lowering.State[cirq.Circuit], value) -> ir.SSAValueParameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
value | — |
Returns
ir.SSAValue
methodlower_global¶source
bloqade.cirq_utils.lowering.Squin.lower_global
Signature
def lower_global(state: lowering.State[cirq.Circuit], node: CirqNode) -> lowering.LoweringABC.ResultParameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | CirqNode |
Returns
lowering.LoweringABC.Result
methodvisit_Circuit¶source
bloqade.cirq_utils.lowering.Squin.visit_Circuit
Signature
def visit_Circuit(state: lowering.State[cirq.Circuit], node: cirq.Circuit | cirq.FrozenCircuit) -> lowering.ResultParameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.Circuit | cirq.FrozenCircuit |
Returns
lowering.Result
methodvisit_Moment¶source
bloqade.cirq_utils.lowering.Squin.visit_Moment
Signature
def visit_Moment(state: lowering.State[cirq.Circuit], node: cirq.Moment) -> lowering.ResultParameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.Moment |
Returns
lowering.Result
methodvisit_GateOperation¶source
bloqade.cirq_utils.lowering.Squin.visit_GateOperation
Signature
def visit_GateOperation(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_TaggedOperation¶source
bloqade.cirq_utils.lowering.Squin.visit_TaggedOperation
Signature
def visit_TaggedOperation(state: lowering.State[cirq.Circuit], node: cirq.TaggedOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.TaggedOperation |
methodvisit_ClassicallyControlledOperation¶source
bloqade.cirq_utils.lowering.Squin.visit_ClassicallyControlledOperation
Signature
def visit_ClassicallyControlledOperation(state: lowering.State[cirq.Circuit], node: cirq.ClassicallyControlledOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.ClassicallyControlledOperation |
methodvisit_MeasurementGate¶source
bloqade.cirq_utils.lowering.Squin.visit_MeasurementGate
Signature
def visit_MeasurementGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_SingleQubitPauliStringGateOperation¶source
bloqade.cirq_utils.lowering.Squin.visit_SingleQubitPauliStringGateOperation
Signature
def visit_SingleQubitPauliStringGateOperation(state: lowering.State[cirq.Circuit], node: cirq.SingleQubitPauliStringGateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.SingleQubitPauliStringGateOperation |
methodvisit_HPowGate¶source
bloqade.cirq_utils.lowering.Squin.visit_HPowGate
Signature
def visit_HPowGate(state: lowering.State[cirq.Circuit], node: cirq.HPowGate)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.HPowGate |
methodvisit_XPowGate¶source
bloqade.cirq_utils.lowering.Squin.visit_XPowGate
Signature
def visit_XPowGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_YPowGate¶source
bloqade.cirq_utils.lowering.Squin.visit_YPowGate
Signature
def visit_YPowGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_ZPowGate¶source
bloqade.cirq_utils.lowering.Squin.visit_ZPowGate
Signature
def visit_ZPowGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_Rx¶source
bloqade.cirq_utils.lowering.Squin.visit_Rx
Signature
def visit_Rx(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_Ry¶source
bloqade.cirq_utils.lowering.Squin.visit_Ry
Signature
def visit_Ry(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_Rz¶source
bloqade.cirq_utils.lowering.Squin.visit_Rz
Signature
def visit_Rz(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_PhasedXZGate¶source
bloqade.cirq_utils.lowering.Squin.visit_PhasedXZGate
Signature
def visit_PhasedXZGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_CXPowGate¶source
bloqade.cirq_utils.lowering.Squin.visit_CXPowGate
Signature
def visit_CXPowGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_CZPowGate¶source
bloqade.cirq_utils.lowering.Squin.visit_CZPowGate
Signature
def visit_CZPowGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_CCZPowGate¶source
bloqade.cirq_utils.lowering.Squin.visit_CCZPowGate
Signature
def visit_CCZPowGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Lower a cirq CCZ power gate with an odd integer exponent to a CCZ gate.
Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_SwapPowGate¶source
bloqade.cirq_utils.lowering.Squin.visit_SwapPowGate
Signature
def visit_SwapPowGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_ZZPowGate¶source
bloqade.cirq_utils.lowering.Squin.visit_ZZPowGate
Signature
def visit_ZZPowGate(state: lowering.State[cirq.Circuit], node: cirq.GateOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.GateOperation |
methodvisit_ControlledOperation¶source
bloqade.cirq_utils.lowering.Squin.visit_ControlledOperation
Signature
def visit_ControlledOperation(state: lowering.State[cirq.Circuit], node: cirq.ControlledOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.ControlledOperation |
methodvisit_FrozenCircuit¶source
bloqade.cirq_utils.lowering.Squin.visit_FrozenCircuit
Signature
def visit_FrozenCircuit(state: lowering.State[cirq.Circuit], node: cirq.FrozenCircuit)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.FrozenCircuit |
methodvisit_CircuitOperation¶source
bloqade.cirq_utils.lowering.Squin.visit_CircuitOperation
Signature
def visit_CircuitOperation(state: lowering.State[cirq.Circuit], node: cirq.CircuitOperation)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.CircuitOperation |
methodvisit_BitFlipChannel¶source
bloqade.cirq_utils.lowering.Squin.visit_BitFlipChannel
Signature
def visit_BitFlipChannel(state: lowering.State[cirq.Circuit], node: cirq.BitFlipChannel)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.BitFlipChannel |
methodvisit_DepolarizingChannel¶source
bloqade.cirq_utils.lowering.Squin.visit_DepolarizingChannel
Signature
def visit_DepolarizingChannel(state: lowering.State[cirq.Circuit], node: cirq.DepolarizingChannel)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.DepolarizingChannel |
methodvisit_AsymmetricDepolarizingChannel¶source
bloqade.cirq_utils.lowering.Squin.visit_AsymmetricDepolarizingChannel
Signature
def visit_AsymmetricDepolarizingChannel(state: lowering.State[cirq.Circuit], node: cirq.AsymmetricDepolarizingChannel)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.AsymmetricDepolarizingChannel |
methodvisit_ResetChannel¶source
bloqade.cirq_utils.lowering.Squin.visit_ResetChannel
Signature
def visit_ResetChannel(state: lowering.State[cirq.Circuit], node: cirq.ResetChannel)Parameters
| Name | Type | Description |
|---|---|---|
state | lowering.State[cirq.Circuit] | |
node | cirq.ResetChannel |