Approximately equal circuits with symbols not detected by cirq.approx_eq
See original GitHub issueDescription of the issue
Circuits with symbols are determined to be unequal by cirq.approx_eq
when they should be approximately equal.
How to reproduce the issue
q = cirq.GridQubit(0, 0)
s = sympy.Symbol("s")
no_symbol_1 = cirq.Circuit(cirq.rz(1.515)(q))
no_symbol_2 = cirq.Circuit(cirq.rz(1.510)(q))
print(cirq.approx_eq(no_symbol_1, no_symbol_2, atol=0.1))
symbol_1 = cirq.Circuit(cirq.rz(1.515*s)(q))
symbol_2 = cirq.Circuit(cirq.rz(1.510*s)(q))
print(cirq.approx_eq(symbol_1, symbol_2, atol=0.1))
First output is True
, second output is False
Cirq version 0.8.2
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Using parametrised values and 'Symbols' in Cirq
So when you write cirq.Rx(cirq.Symbol("θ")) it internally attempts to scale the argument, and you get an error about multiplication/division not ...
Read more >Unicode Characters: 02A00 to 02AFF
02A0 02A1 02A2 02A3 02A4 02A5 02A6 02A7 02A8 02A9 02AA 02AB 02AC 02AD
0 ⨀ ⨐ ⨠ ⨰ ⩀ ⩐ ⩠ ⩰ ⪀...
Read more >other symbols used in math
More information about mathematical symbols may be found in individual ... Note that "approximately equal" is reflexive and symmetric but not transitive.
Read more >HTML Math Symbols, Entities and Codes
Easily find HTML math symbols, entities, characters and codes with ASCII, HEX, ... greater than and less than signs, equals sign, not equal...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Is help still needed on this? I am looking for a good first issue.
Thank you for filing this @zaqqwerty - this should work. Either approx_eq should throw an error if the arguments are parametrized that it’s not supported or support it properly. This behavior is a silent failure. Marked it as a bug.
It also seems like a self contained issue, perfect for contributors to pick up!