Remix.run Logo
jdw64 3 hours ago

https://github.com/microsoft/azure-quantum-tgp

```

return xr.apply_ufunc(

    lambda x: (x - x[::-1]) / 2,

    conductance,

    input_core_dims=[dims],

    output_core_dims=[dims],

    vectorize=True,
) ```

Reading the article about how they filtered and cherry-picked specific regions, I got curious about the actual asymmetry computation, so I looked up the source code. Looking at it, they seem to have used memory offsets as if they were physical coordinates, but they're only looking at the array index order, not the actual values. x[::-1] isn't measuring physical coordinates; it's just reversing the array. So it seems this bias axis mentioned in the article only forms when things are symmetric. But in typical numerical computations, isn't it pretty common to reverse arrays like this? In this case, there must be a reason why the physical coordinates change. Should we be verifying invariants here? Sometimes I see people who find these kinds of issues and I think they're really amazing. Even after reading the article, tracing it, and debugging it, I kept wondering what the problem was..

simonw 2 hours ago | parent [-]

On Hacker News you can indent code samples with two spaces, like this:

  return xr.apply_ufunc(
      lambda x: (x - x[::-1]) / 2,
      conductance,
      input_core_dims=[dims],
      output_core_dims=[dims],
      vectorize=True,
  )