0
$\begingroup$

I'm encoding data into a QuantumCircuit via the Initialize method for QFTs. In doing this and transpiling for IonQ backends, I'm getting rather complex circuits. Is there a way to encode this data more efficiently for IonQ backends or a method to approximate this circuit? Thanks in advance!

Encoding a sine wave into an 8 qbit register, then transpiling for IonQ sim backend

$\endgroup$

2 Answers 2

1
$\begingroup$

I think that the QuantumCircuit.initialize() method isn't always providing the most efficient state preparations.

I have tried to initialize some very simple states, like $|11⟩$ for 2-qubits system:

  1. In the first case I just used simple 2 NOT gates (which are also native gates in all the quantum computers that I know), so the the transpiled version is pretty much the same:

enter image description here

  1. In the second case I have used qc.initialize([0,0,0,1]) to initialize the same $|11⟩$ state and the results are very ugly:

enter image description here

Along with this talking I can infer that QuantumCircuit.initialize() isn't providing always the most efficient method for setting a desired state. And that's probably the reason that so many gates are used in order to set the 8-qubits state above.

Try to set up the desired state manually (I don't understand exactly which state you are trying to initialize here so I can't tell you exactly how to do it for now).

$\endgroup$
0
$\begingroup$

Try using isometry instead of initialize:

qc.isometry(y/np.linalg.norm(y), [*range(n_qubits)], [])

Also, try setting optimization_level to 3 for transpile method. Most of the time this will reduce number of gates.

qc1 = transpile(circuits=qc, backend=backend, optimization_level=3)
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.