Skip to content

Implement cyclic binary shift in Jasp #330

@diehoq

Description

@diehoq

Cyclic binary shifts can be used to perform multiplication and division by 2 mod(2ⁿ − 1) on n-bits QuantumFloats. For the time being, this operation is not available in dynamic mode:

@jaspify
def main():

    a = QuantumFloat(4)
    a[:] = 7
    
    cyclic_shift(a)
    return measure(a)

main()

yields:
TracerIntegerConversionError: The __index__() method was called on traced array with shape int64[]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions