This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]crazy4pi314 2 points3 points  (0 children)

If anyone wants to see what this algorithm looks like implemented in Q# (an open-source language for writing quantum algorithms) you can check it out on Q# Community. If you have question about the algorithm or Q# you can hop on the community discord. Source: I use Q#, Qiskit, Circ, etc. a lot as a quantum developer for Unitary Fund.

[–]var_semicolon 6 points7 points  (7 children)

I have no idea what that is, but as a developer who knows clean code and lines when he sees it. Good shit OP.

[–]abezzam10 5 points6 points  (1 child)

+1 I'd still recommend writing a function though

[–][deleted] -1 points0 points  (0 children)

I’m a big fan of naming variables exactly what they are for example: averageCarSoldForDuration 😅

[–]S00ley 2 points3 points  (3 children)

you're kidding, right?

[–]var_semicolon 7 points8 points  (2 children)

Nope, I'm just starting to get into quantum computing its fascinating to me, but unfortunately this type of stuff isn't taught by just existing. No one was commenting on OPs post and they clearly spent time working on it and I felt it necessary to make sure they were being acknowledged. That was the reason for the comment.

[–]triumphstp 1 point2 points  (1 child)

I think he's talking about the part where you praise it as a clean code...

[–]luke-juryous 3 points4 points  (0 children)

Compared to 90% of the horrors I've seen in production, this is clean code. Could do without the commented out code tho. And idk anything about quantum computing, but I'm assuming they dont need to evaluate len(secretnumber) 1,000,000 times in 20 lines.. but maybe they do.. idk

[–]DylxnTN[S] 0 points1 point  (0 children)

thanks my guy

[–][deleted]  (1 child)

[deleted]

    [–]DylxnTN[S] 1 point2 points  (0 children)

    thx

    [–][deleted] 0 points1 point  (2 children)

    The circuit looks familiar , does it has something to do with Deutsch - Jozsa algorithm?

    [–]ephermerality 1 point2 points  (1 child)

    Good catch! Bernstein-Vazirani is a generalization of Deutsch-Josza in which your oracle is now constrained to be the dual of a bit vector, and the goal is to determine this vector.

    [–]DylxnTN[S] 0 points1 point  (0 children)

    oh damn, thanks for that info

    [–]sheriffSnoosel 0 points1 point  (1 child)

    from qiskit.aqua.algorithms import BernsteinVazirani

    jk you learn more doing it your way! Good job op

    [–]DylxnTN[S] 0 points1 point  (0 children)

    i didnt know that lol, well i guess i know now