Coder Social home page Coder Social logo

Comments (3)

yapolyak avatar yapolyak commented on September 23, 2024

Oh I've just managed to reproduce the result the State.compute() is giving me! If I transpose the unitary, I get the same result! But why is this the case, and should I transpose every unitary that goes into State?

from cuquantum.

yapolyak avatar yapolyak commented on September 23, 2024

I now recall that you do transpose Pauli unitaries in your example, and have been ignoring that... This probably is due to necessity of using 'F'-style ordering, right?

from cuquantum.

yapolyak avatar yapolyak commented on September 23, 2024

Another update - if I try and provide gate_ry strides explicitly (by using cupy.ndarray.strides() (accounted for the data type byte length) to cutn.state_apply_tensor(), it gives me a wrong result anyway, unless I transpose the array.

However, if I use order='C', don't transpose and Don't provide strides (pass 0) I get the right result. I think I understand why this would work (order='C' is doing the same thing as transposing here), but why if I provide explicit strides it fails? Specifically, I calculate the strides as follows:

gate_ry = cp.asarray([[ 0.33873792+0.j, -0.94088077+0.j],
                      [ 0.94088077+0.j,  0.33873792+0.j]]).astype(dtype='complex128', order='C')
gate_ry_strides = tuple(int(stride/16) for stride in gate_ry.strides)

from cuquantum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.