0
$\begingroup$

I'm doing a simulation of the QAOA algorithm with noise via the QAOA class of Qiskit 0.19. Here's (part of) my code:

p=1
In_params=np.random.rand(2*p)*np.pi/2
optalg= SPSA(max_trials=1000)

backend = Aer.get_backend('qasm_simulator')
model_device= provider.get_backend('ibmq_16_melbourne')
device_prop = model_device.properties()
noisemodel= NoiseModel.from_backend(device_prop)

quantum_instance=QuantumInstance(backend, shots=1024, noise_model=noisemodel)
qaoa = QAOA(qubitOp, optalg, p, initial_point=In_params, callback= mycallback)
qaoa.expectation=PauliExpectation()
result = qaoa.run(quantum_instance)

I'm using the default initial state, that is $|+\rangle^{\otimes n}$, constructed automatically by QAOA using Hadamard gates. I'm using a noise model for the execution: is the initial state construction affected by noise also?

Thanks!

$\endgroup$
  • $\begingroup$ Hi @Laura! I don't see exactly where you are using specifying the $|+\rangle^{\otimes n}$ state as initial state for QAOA. By default QAOA should use the zero state as initial state. In general, the initial state is broken down to be a circuit so it will also be affected by the noise model. $\endgroup$ – Cryoris May 14 at 15:36
  • $\begingroup$ Hi, thanks for your comment (and for editing my question! I saw in the class QAOAVarForm, in the construct_circuit section that there's always an Hagamard gate acting on all qubits before the circuit (eventually) provided by the user to construct the "Initial state" is appended That is because i think that uniform state is the default state... Am i wrong? $\endgroup$ – Laura May 14 at 18:17
  • $\begingroup$ Ah, yes the QAOAVarForm starts with a layer on H gates that is correct. But there also is the explicit initial_state argument which can be used to start from a custom initial state. I thought this is what you referred to. As the initial_state defaults to $|0\rangle^{\otimes n}$, the state is $|+\rangle^{\otimes n}$ after the first layer. So yes, the noise model affects the construction of that $|+\rangle^{\otimes n}$ state. $\endgroup$ – Cryoris May 14 at 18:28

Your Answer

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

Browse other questions tagged or ask your own question.