loom.cliffordsim.operations.classical_operation
Copyright (c) Entropica Labs Pte Ltd 2025.
Use, distribution and reproduction of this program in its source or compiled form is prohibited without the express written consent of Entropica Labs Pte Ltd.
- class loom.cliffordsim.operations.classical_operation.ClassicalAND(reg_name, input_bit_order=<factory>, input_bit_ids=<factory>, output_reg_name=None, write_bit_order=None, write_bit_id=None)[source]
Bases:
ClassicalTwoBitOperationEvaluates a classical AND operation from 2 input bits and writes the output onto a referenced bit, known as the write bit.
-
name:
str= 'ClassicalAND'
-
name:
- class loom.cliffordsim.operations.classical_operation.ClassicalNOT(reg_name, bit_order=None, bit_id=None)[source]
Bases:
ClassicalOperationApply a classical NOT operation on a bit.
- Parameters:
reg_name (str) – The name of the classical register whose bit to apply the Operation to.
bit_order (int) – The numerical order of the bit within the classical register.
bit_id (str) – The ID of the bit within the classical register.
-
bit_id:
str= None
-
bit_order:
int= None
-
name:
str= 'ClassicalNOT'
-
reg_name:
str
- class loom.cliffordsim.operations.classical_operation.ClassicalOR(reg_name, input_bit_order=<factory>, input_bit_ids=<factory>, output_reg_name=None, write_bit_order=None, write_bit_id=None)[source]
Bases:
ClassicalTwoBitOperationEvaluates a classical OR operation from 2 input bits and writes the output onto a referenced bit, known as the write bit.
-
name:
str= 'ClassicalOR'
-
name:
- class loom.cliffordsim.operations.classical_operation.ClassicalOperation[source]
Bases:
OperationOperations of this type manipulate classical bits within the Engine during runtime.
-
operation_type:
Enum= 'Classical'
- with_ccontrol(reg_name, bit_order=None, bit_id=None)
This method returns a ControlledOperation wrapped version of the Operation class. The wrapped Operation class is classically controlled by the bit from the classical register specified by reg_name in bit_order or by bit_id.
NOTE: ControlledOperation(s) can only be conditioned on one classical bit.
-
operation_type:
- class loom.cliffordsim.operations.classical_operation.ClassicalTwoBitOperation(reg_name, input_bit_order=<factory>, input_bit_ids=<factory>, output_reg_name=None, write_bit_order=None, write_bit_id=None)[source]
Bases:
ClassicalOperationClassical 2 Bit Operations that require 2 bits as input and 1 bit as output.
- Parameters:
reg_name (str) – The name of the classical register whose bits is used as input to evaluate the 2-bit operation.
input_bit_order (list[int]) – The order of the bits within the classical register that will be used as inputs for the 2-bit operation.
input_bit_ids (list[str]) – The bit IDs of the bits within the classical reigster that will be used as inputs for the 2-bit operation.
output_reg_name (Optional[str]) – The name of the classical register where the output of the 2-bit operation will be written to. If not provided, this is equal to the register referred to by reg_name.
write_bit_order (int) – The order of the bit within the classical register, specified by output_reg_name, where the output of the 2-bit operation will be written to.
write_bit_ids (str) – The bit ID of the bit within the classical register, specified by output_reg_name, where the output of the 2-bit operation will be written to.
-
input_bit_ids:
list[str]
-
input_bit_order:
list[int]
-
output_reg_name:
Optional[str] = None
-
reg_name:
str
-
write_bit_id:
str= None
-
write_bit_order:
int= None