Giter Club home page Giter Club logo

Comments (2)

anpaz avatar anpaz commented on May 21, 2024

From the strack-trace, looks like:

ArrayFromIndicies is not figuring out that 'T is of type Pauli (which is strange, since 'T is in the values argument) so it defaults to object --> that causes that the resolved type for the array is object[], but looks like QArray doesn't support objects so it fails.

This seems related to #47, however, for this one I would start on GenericaCallable.FindCallable to figure out why the Type parameter 'T from ArrayFromIndicies is not correctly identified.

from qsharp-runtime.

bettinaheim avatar bettinaheim commented on May 21, 2024

I did a quick investigation and the problem is that IsValidValue(Type targetType, object partialValues) will fail for the target type being an IQArray of objects and the partialValues being a concrete array of something (Paulis in this case). This is unfortunately how ArrayFromIndicies(values,_) currently get's translated. To fix this we would need to construct the mapper at runtime in this case, i.e.
whether or not to build the partial mapper on code gen has to be determined based on whether the original callable had type parameters (not the partially applied one), but then PartialApplicationTypes needs to be adapted I think.

from qsharp-runtime.

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.