Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Barry Burd
    @allmycode_twitter
    There were no subfolders to delete.
    Barry Burd
    @allmycode_twitter
    Problem solved :-) Was looking in the wrong folder for the obj subfolder. Thank you @cgranade and @tcNickolas_twitter .
    vashisth malik
    @VashisthMalik_twitter
    @tcNickolas_twitter @cgranade I am participating in warm up contest . Just new to q# . From where I can get the syntax of language fast?
    Mariia Mykhailova
    @tcNickolas_twitter
    @VashisthMalik_twitter The contest announcement has a lot of starting links, two good resources are https://docs.microsoft.com/quantum and https://github.com/Microsoft/QuantumKatas/, the latter have a lot of practice problems with solutions worked out. Enjoy the contest!
    Harshit Garg
    @githg22_gitlab
    Is anyone else stuck on the increment problem? I think my code is correct but it doesn't satisfy the Adj+Ctl thing because it uses measurement
    Cassandra Granade
    @cgranade
    @githg22_gitlab: Is that one of the contest problems? If so, you should be able to do it without measurement, so that your solution can in principle be used when your input register is in superposition.

    @githg22_gitlab: Taking a hint from the problem statement itself, I'd suggest that the last sentence is especially relevant here.

    "This operation can be implemented using just the X gate and its controlled variants."

    Harshit Garg
    @githg22_gitlab
    @cgranade It's more like I'm using an extra qubit that needs to be reset and that functor wouldn't keep the operation Adj
    And I can't find a way to test it locally through python
    Sagar Mishra
    @achieveordie
    I've got a small question, Can we apply the unwrapping operator on LittleEndian? I don't think we can do that because of the no-clone theorem, I can solve the increment problem with array of qubits, but cannot wrap my mind to do that on LittleEndian. I couldn't find any relevant operation in Microsoft.Quantum.Arithematic to apply X gate on Little Endian either...
    Harshit Garg
    @githg22_gitlab
    Yup you can do that
    Just write !
    Just write register!
    Stupid gitter
    LittleEndian is basically a different name for Qubit[], literally no other difference
    Sagar Mishra
    @achieveordie
    Won't that be qarray = LittleEndian!?
    I mean, I get what you mean, but I still find it a bit uncomfortable without having to use using()
    Also, as a side question, does the changes that we make on the unwrapped array reflected automatically in the user-defined LittleEndian?
    Harshit Garg
    @githg22_gitlab
    I think it does
    So umm
    Cam you give a hint as to how you solved the problem?
    I've been stuck at this for the past 24 hours
    Sagar Mishra
    @achieveordie
    I hope it isn't against the protocol, say you've got N=3. On a paper, write down the values in LittleEndian format from 0 to 7 and then write down the required result, again in LittleEndian format. You'll notice something, one of the qubits will always flip no matter what while the others will flip if a certain condition is satisfied(hence the usage of Controlled X) I hope this will help you.
    Also, I tried using the unwrap operator and I got a compilation error saying the expression can only be applied on user-defined type while LittleEndian is a custom user-defined(Microsoft.Quantum.Arithematic.LittleEndian)
    Harshit Garg
    @githg22_gitlab
    That's weird I could use it in my code
    Its not against the rules btw, in warmup you're free to discuss hints
    Sagar Mishra
    @achieveordie
    what was your syntax?
    like the expression?
    Harshit Garg
    @githg22_gitlab
    (register!)
    Sagar Mishra
    @achieveordie
    And if that is so, did you solve problem C?
    Harshit Garg
    @githg22_gitlab
    Length(register!)
    For example
    Yeah I solved C
    Sagar Mishra
    @achieveordie
    and if I wanted to access some element, how would do that in LittleEndian?
    Any hints?
    Harshit Garg
    @githg22_gitlab
    register![1]
    C is actually similar to a problem in Quantum Katas
    It's kind of a hack-y method
    Sagar Mishra
    @achieveordie
    In which notebook is it?
    Harshit Garg
    @githg22_gitlab
    Superposition
    Sagar Mishra
    @achieveordie
    X(LittleEndian![0]); is this a valid expression?
    nevermind, I'm stupid.
    wasted 24 hours on something this stupid
    Harshit Garg
    @githg22_gitlab
    hehe it happens
    Were you writing LittleEndian instead of register?
    Sagar Mishra
    @achieveordie
    yep, not the first time when I've doubted my sanity. Thanks for the help
    Harshit Garg
    @githg22_gitlab
    Thank you sir Increment problem was so simple I was thinking wayy too much
    Cassandra Granade
    @cgranade
    @githg22_gitlab: If you allocate an extra qubit, then it has to be returned to |0⟩ at the end of the using block. As you note, you can't use measurement to do that in an adjointable operation; given that resetting is a special case of measurement, the Reset operation will also fail to preserve adjointability. The trick is that you need to coherently reset the qubit to |0⟩ without measurement. You can do that because you know exactly what state it's in at the end of the using, and can unprepare it using only unitary operations. The within/apply feature of Q# or the ApplyWithCA operation will be very handy here.

    By the way, @crazy4pi314 will be streaming with @bettinaheim about the Q# compiler today in a little under three hours if anyone is interested to join at https://twitch.tv/crazy4pi314. More details at https://twitter.com/crazy4pi314/status/1271837229221101569.

    #QuantumDevelopWithMe

    Cassandra Granade
    @cgranade
    Stream starting in just a few moments at https://www.twitch.tv/crazy4pi314!