You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assignment really feels like it should create a new register, but instead it just holds an RValue.
The RValues have reference semantics. c = a + b; a += 1; d += c; is equivalent to d += a + b + 1; a += 1 not d += a + b; a += 1. Might need some kind of copy-on-write mechanism.
Some operations are irreversible. Can't support a %= 5 unless it implies a measurement of a//5.
Modular arithmetic doesn't work as nicely as I'd like. You can't say a.working_modulo(5) += 2.
Sure! But as mentioned in #71 , I'd prefer to put such functionality in a new type (e.g., Quint in this case).
Indeed, this works nicely for some functions and not so nicely for others... I think we should nevertheless try to make "quantum math" easy to use and implementing, e.g., addition and multiplication would be a good first step.
Add
+=
,^=
, etc operators to Qureg:Also add RValue-producing
+
,~
,&
etc operators:Add RValue classes:
And then users can do arithmetic in a way that looks quite like normal python:
The text was updated successfully, but these errors were encountered: