qiskit-community / qiskit-community-tutorials

A collection of Jupyter notebooks developed by the community showing how to use Qiskit
Apache License 2.0
711 stars 511 forks source link

Add input to QFT #9

Closed nighttrain7 closed 5 years ago

nighttrain7 commented 5 years ago

Provide input method?

Hi, I am now using QISKit to realize quantum fourier transform. I run the code provided by you in this link.

The input state is set to 000 by default. Is there any methods to change the input to a different value one that can be in a superposition of selected states going in

Could you please answer my question? Thank you so much!

attp commented 5 years ago

Hi, you can use the initialize function to prepare an arbitrary pure state.

See this example: https://github.com/Qiskit/qiskit-terra/blob/3a5780b0fe6838acc9b249e781d23d8559e0c3a2/examples/python/initialize.py