CQCL / tket

Source code for the TKET quantum compiler, Python bindings and utilities
https://tket.quantinuum.com/
Apache License 2.0
249 stars 48 forks source link

Multiplier not stored as part of multi-bit op #1326

Open Asa-Kosto-QTM opened 5 months ago

Asa-Kosto-QTM commented 5 months ago

The multiplier number for a multi-bit op is not stored anywhere in the MultiBitOp class. Having this number available as a property would make handling the case in pytket-phir more elegant and efficient. suggest the following:

class MultiBitOp(ClassicalEvalOp):
    """
    An operation to apply a classical op multiple times in parallel.  
    """  
    def __init__(self, op: ClassicalEvalOp, multiplier: int) -> None:  
     """ 
     Construct from a basic operation and a multiplier. 
     """  
    @property  
    def basic_op(self) -> ClassicalEvalOp: 
    """  
    Underlying bitwise op.  
    """ 
    @property  
    def multiplier(self) -> int: 
    """  
     Number of times the multi-bit operation is applied.  
    """
github-actions[bot] commented 3 weeks ago

This issue has been automatically marked as stale.