Skip to content

op_serializer fails on gates parameterized by algebraic expressions #2122

@trevormccrt

Description

@trevormccrt

For example, if i create a circuit including cirq.X ** a/2 where a is a sympy symbol, op_serializer.py fails in the _check_value method with the following error:

ValueError: Expected type convertible to float but was <class 'sympy.core.mul.Mul'>

@Strilanc do you know if not supporting this is intentional, or has it just never been added?

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