Skip to content

Serilization of expressions is path dependent #934

@shumpohl

Description

@shumpohl

Currently, qupulse.expressions.sympy.ExpressionScalar remembers the argument with which it was constructed.

This was introduced in 385144d with the goal to "make expression naming more consistent" and allow round-trips like

s = 'a    *    b'
e = Expression(s)
self.assertEqual('Expression(a    *    b)', repr(e))

However, it has the downside of making the repr path dependent. Two equal expressions might have a different repr/serialization representation.

I was not able to reconstruct why we need that repr round-trip functionality.

I would like to either document the reasoning for original_expression in the code or drop it. At least for get_serialization_data.

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