question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Y^-0.5` not being converted to `PhasedX(-0.5)^0.5` on Ion related tests in Windows.

See original GitHub issue

As a reference: https://travis-ci.com/quantumlib/Cirq/jobs/201514754

For test_convert_to_ion_circuit

E       AssertionError: Circuit's text diagram differs from the desired diagram.
E
E       Diagram of actual circuit:
E       (0, 0): ───X───────MS(0.25Ο€)───X^-0.5──────────MS(0.25Ο€)───
E                          β”‚                           β”‚
E       (0, 1): ───Y^0.5───MS(0.25Ο€)───Y^-0.5───S^-1───MS(0.25Ο€)───
E
E       Desired text diagram:
E       (0, 0): ───X───────MS(0.25Ο€)───X^-0.5─────────────────────MS(0.25Ο€)───
E                          β”‚                                      β”‚
E       (0, 1): ───Y^0.5───MS(0.25Ο€)───PhasedX(-0.5)^0.5───S^-1───MS(0.25Ο€)───
E
E       Highlighted differences:
E       (0, 0): ───X───────MS(0.25Ο€)───X^-0.5β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”€β”€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
E                          β”‚                           β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
E       (0, 1): ───Y^0.5───MS(0.25Ο€)β”€β”€β”€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”€β”€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ

For test_decomposition

E       AssertionError: Circuit's text diagram differs from the desired diagram.
E
E       Diagram of actual circuit:
E       0: ───Y^0.5───Z───MS(0.25Ο€)───Y^-0.5───S^-1───
E                         β”‚
E       1: ───────────────MS(0.25Ο€)───X^-0.5──────────
E
E       Desired text diagram:
E       0: ───Y^0.5───Z───MS(0.25Ο€)───PhasedX(-0.5)^0.5───S^-1───
E                         β”‚
E       1: ───────────────MS(0.25Ο€)───X^-0.5─────────────────────
E
E       Highlighted differences:
E       0: ───Y^0.5───Z───MS(0.25Ο€)β”€β”€β”€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
E                         β”‚
E       1: ───────────────MS(0.25Ο€)───X^-0.5β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ

CC: @mlihc15 , @c-poole

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
c-poolecommented, May 22, 2019

If you try to construct a PhasedX(-0.5)^0.5 cirq will recognize that as a Y^-0.5 and return that instead, but this relies on the -0.5 in the PhasedX passing a float equality comparison, so it isn’t too terribly surprising that floating point comparisons are causing system dependent differences. What seems to matter in this test is whether the circuits produced are equivalent and whether they pass the validate_circuit method of ion_device. I rewrote the tests with this in mind and they pass so I’ll put in a PR for it.

0reactions
vtomolecommented, May 20, 2019

@mlihc15 Yeah, this probably doesn’t have to do with the rendering because the only problem we seem to be having here is Y^-0.5 not being converted to PhasedX(-0.5)^0.5. This seems to be related to Windows somehow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ion Concentration in Solutions From Molarity, Chemistry ...
This chemistry video tutorial explains how to calculate the ion concentration in solutions from molarity. This video contains plenty ofΒ ...
Read more >
Spectra 5000.pdf - U.S. Naval Research Laboratory
Simultaneous Optical Beam Forming for Phased-Array Applications ... pumping a silica fiber that has been infused with rare earth ions of holmium.
Read more >
Solubility Product Constants, K sp
Since the equilibrium constant refers to the product of the concentration of the ions that are present in a saturated solution of an...
Read more >
Calibration and Control of Advanced Ultrasonic Array ...
Phased array technology provides increased exibility relative to single element monolithic transducers and the development of controlling hardware with largeΒ ...
Read more >
Impact of A-Site Cation Deficiency on Charge Transport in La0 ...
The electrical conductivity of La0.5βˆ’xSr0.5FeO3βˆ’Ξ΄, investigated as a function of the nominal cation deficiency in the A-sublattice, x,Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found