Preparing odd integers using quantum computationHow do I add 1+1 using a quantum computer?Embedding classical information into norm of a quantum stateImplementation of the oracle of Grover's algorithm on IBM Q using three qubitsSWAP gate(s) in the $R(lambda^-1)$ step of the HHL circuit for $4times 4$ systemsHow to prevent future loops using a control qubit?Quantum addition and modulo operation using gatesQuantum secret Sharing using GHZ state paperPerform quantum gate operations using state vectors and matrices

What's the benefit of prohibiting the use of techniques/language constructs that have not been taught?

Meaning of Swimming their horses

Why don't Wizards use wrist straps to protect against disarming charms?

What was the motivation for the invention of electric pianos?

Some Prime Peerage

Seven Places at Once - Another Google Earth Challenge?

Ethernet, Wifi and a little human psychology

What is the meaning of "order" in this quote?

Can a character with good/neutral alignment attune to a sentient magic item with evil alignment?

Wrong Schengen Visa exit stamp on my passport, who can I complain to?

Python web-scraper to download table of transistor counts from Wikipedia

Pronunciation of "солнце"

Importance of the current postdoc advisor's letter in TT job search

Prove that a convergent real sequence always has a smallest or a largest term

International Orange?

Work done by spring force

How to publish superseding results without creating enemies

Why don't airports use arresting gears to recover energy from landing passenger planes?

Other than good shoes and a stick, what are some ways to preserve your knees on long hikes?

Bit one of the Intel 8080's Flags register

What does "boys rule, girls drool" mean?

What organs or modifications would be needed for a life biological creature not to require sleep?

geschafft or geschaffen? which one is past participle of schaffen?

If I want an interpretable model, are there methods other than Linear Regression?



Preparing odd integers using quantum computation


How do I add 1+1 using a quantum computer?Embedding classical information into norm of a quantum stateImplementation of the oracle of Grover's algorithm on IBM Q using three qubitsSWAP gate(s) in the $R(lambda^-1)$ step of the HHL circuit for $4times 4$ systemsHow to prevent future loops using a control qubit?Quantum addition and modulo operation using gatesQuantum secret Sharing using GHZ state paperPerform quantum gate operations using state vectors and matrices






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1












$begingroup$


This is just a basic question. I need to output odd integers till $15$, i.e $1,3,5,7,9,11,13,15$. Since $15$ requires $4$ bits, I prepare initial state by using Hadamard gate on initial $|0rangle$, i.e $$H|0rangle otimes H|0rangle otimes H|0rangle$$ $$=|000rangle+|001rangle+|010rangle+|011rangle+|100rangle+|101rangle+|110rangle+|111rangle.$$ Then take the tensor product with $|1rangle$, i.e $$(H|0rangle otimes H|0rangle otimes H|0rangle)|1rangle$$ $$=|0001rangle+|0011rangle+|0101rangle+|0111rangle+|1001rangle+|1011rangle+|1101rangle+|1111rangle.$$ Is this right?
Actually, I know the ideas but don't know how to write it in the quantum computing terms, that involves using terms as registers, qubits










share|improve this question











$endgroup$




















    1












    $begingroup$


    This is just a basic question. I need to output odd integers till $15$, i.e $1,3,5,7,9,11,13,15$. Since $15$ requires $4$ bits, I prepare initial state by using Hadamard gate on initial $|0rangle$, i.e $$H|0rangle otimes H|0rangle otimes H|0rangle$$ $$=|000rangle+|001rangle+|010rangle+|011rangle+|100rangle+|101rangle+|110rangle+|111rangle.$$ Then take the tensor product with $|1rangle$, i.e $$(H|0rangle otimes H|0rangle otimes H|0rangle)|1rangle$$ $$=|0001rangle+|0011rangle+|0101rangle+|0111rangle+|1001rangle+|1011rangle+|1101rangle+|1111rangle.$$ Is this right?
    Actually, I know the ideas but don't know how to write it in the quantum computing terms, that involves using terms as registers, qubits










    share|improve this question











    $endgroup$
















      1












      1








      1





      $begingroup$


      This is just a basic question. I need to output odd integers till $15$, i.e $1,3,5,7,9,11,13,15$. Since $15$ requires $4$ bits, I prepare initial state by using Hadamard gate on initial $|0rangle$, i.e $$H|0rangle otimes H|0rangle otimes H|0rangle$$ $$=|000rangle+|001rangle+|010rangle+|011rangle+|100rangle+|101rangle+|110rangle+|111rangle.$$ Then take the tensor product with $|1rangle$, i.e $$(H|0rangle otimes H|0rangle otimes H|0rangle)|1rangle$$ $$=|0001rangle+|0011rangle+|0101rangle+|0111rangle+|1001rangle+|1011rangle+|1101rangle+|1111rangle.$$ Is this right?
      Actually, I know the ideas but don't know how to write it in the quantum computing terms, that involves using terms as registers, qubits










      share|improve this question











      $endgroup$




      This is just a basic question. I need to output odd integers till $15$, i.e $1,3,5,7,9,11,13,15$. Since $15$ requires $4$ bits, I prepare initial state by using Hadamard gate on initial $|0rangle$, i.e $$H|0rangle otimes H|0rangle otimes H|0rangle$$ $$=|000rangle+|001rangle+|010rangle+|011rangle+|100rangle+|101rangle+|110rangle+|111rangle.$$ Then take the tensor product with $|1rangle$, i.e $$(H|0rangle otimes H|0rangle otimes H|0rangle)|1rangle$$ $$=|0001rangle+|0011rangle+|0101rangle+|0111rangle+|1001rangle+|1011rangle+|1101rangle+|1111rangle.$$ Is this right?
      Actually, I know the ideas but don't know how to write it in the quantum computing terms, that involves using terms as registers, qubits







      quantum-gate quantum-state






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 15 at 10:57









      Sanchayan Dutta

      8,1224 gold badges18 silver badges63 bronze badges




      8,1224 gold badges18 silver badges63 bronze badges










      asked Apr 15 at 7:13









      UpstartUpstart

      4131 silver badge9 bronze badges




      4131 silver badge9 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          4














          $begingroup$

          It depends what you mean by "output odd integers till 15". If you actually mean "prepare a uniform superposition of all odd, positive integers up to and including 15", then yes, you are essentially correct. The only thing to say is that your initial preparation using Hadamards is only over 3 qubits, not 4 (you've got 4 qubits on the left-hand side and 3 on the right-hand side). Similarly for your second equation, you've got 5 qubits on the left-hand side and 4 on the right. You would also be safer to include the normalisation factor.






          share|improve this answer









          $endgroup$














          • $begingroup$
            i have edited it
            $endgroup$
            – Upstart
            Apr 15 at 7:21










          • $begingroup$
            @Upstart better :)
            $endgroup$
            – DaftWullie
            Apr 15 at 7:38













          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "694"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fquantumcomputing.stackexchange.com%2fquestions%2f5915%2fpreparing-odd-integers-using-quantum-computation%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          $begingroup$

          It depends what you mean by "output odd integers till 15". If you actually mean "prepare a uniform superposition of all odd, positive integers up to and including 15", then yes, you are essentially correct. The only thing to say is that your initial preparation using Hadamards is only over 3 qubits, not 4 (you've got 4 qubits on the left-hand side and 3 on the right-hand side). Similarly for your second equation, you've got 5 qubits on the left-hand side and 4 on the right. You would also be safer to include the normalisation factor.






          share|improve this answer









          $endgroup$














          • $begingroup$
            i have edited it
            $endgroup$
            – Upstart
            Apr 15 at 7:21










          • $begingroup$
            @Upstart better :)
            $endgroup$
            – DaftWullie
            Apr 15 at 7:38















          4














          $begingroup$

          It depends what you mean by "output odd integers till 15". If you actually mean "prepare a uniform superposition of all odd, positive integers up to and including 15", then yes, you are essentially correct. The only thing to say is that your initial preparation using Hadamards is only over 3 qubits, not 4 (you've got 4 qubits on the left-hand side and 3 on the right-hand side). Similarly for your second equation, you've got 5 qubits on the left-hand side and 4 on the right. You would also be safer to include the normalisation factor.






          share|improve this answer









          $endgroup$














          • $begingroup$
            i have edited it
            $endgroup$
            – Upstart
            Apr 15 at 7:21










          • $begingroup$
            @Upstart better :)
            $endgroup$
            – DaftWullie
            Apr 15 at 7:38













          4














          4










          4







          $begingroup$

          It depends what you mean by "output odd integers till 15". If you actually mean "prepare a uniform superposition of all odd, positive integers up to and including 15", then yes, you are essentially correct. The only thing to say is that your initial preparation using Hadamards is only over 3 qubits, not 4 (you've got 4 qubits on the left-hand side and 3 on the right-hand side). Similarly for your second equation, you've got 5 qubits on the left-hand side and 4 on the right. You would also be safer to include the normalisation factor.






          share|improve this answer









          $endgroup$



          It depends what you mean by "output odd integers till 15". If you actually mean "prepare a uniform superposition of all odd, positive integers up to and including 15", then yes, you are essentially correct. The only thing to say is that your initial preparation using Hadamards is only over 3 qubits, not 4 (you've got 4 qubits on the left-hand side and 3 on the right-hand side). Similarly for your second equation, you've got 5 qubits on the left-hand side and 4 on the right. You would also be safer to include the normalisation factor.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 15 at 7:18









          DaftWullieDaftWullie

          20.4k1 gold badge9 silver badges51 bronze badges




          20.4k1 gold badge9 silver badges51 bronze badges














          • $begingroup$
            i have edited it
            $endgroup$
            – Upstart
            Apr 15 at 7:21










          • $begingroup$
            @Upstart better :)
            $endgroup$
            – DaftWullie
            Apr 15 at 7:38
















          • $begingroup$
            i have edited it
            $endgroup$
            – Upstart
            Apr 15 at 7:21










          • $begingroup$
            @Upstart better :)
            $endgroup$
            – DaftWullie
            Apr 15 at 7:38















          $begingroup$
          i have edited it
          $endgroup$
          – Upstart
          Apr 15 at 7:21




          $begingroup$
          i have edited it
          $endgroup$
          – Upstart
          Apr 15 at 7:21












          $begingroup$
          @Upstart better :)
          $endgroup$
          – DaftWullie
          Apr 15 at 7:38




          $begingroup$
          @Upstart better :)
          $endgroup$
          – DaftWullie
          Apr 15 at 7:38


















          draft saved

          draft discarded















































          Thanks for contributing an answer to Quantum Computing Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fquantumcomputing.stackexchange.com%2fquestions%2f5915%2fpreparing-odd-integers-using-quantum-computation%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Tamil (spriik) Luke uk diar | Nawigatjuun

          Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

          Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?