Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

VQC algorithm fails with initial_layout and measurement_error_mitigation_cls #744

Closed
AzizNgoueya opened this issue Dec 9, 2019 · 1 comment

Comments

@AzizNgoueya
Copy link

Informations

  • Qiskit Aqua version: 0.6.1
  • Python version: 3.7.4
  • Operating system: Windows

What is the current behavior?

I created a quantum instance with initial_layout and measurement_error_mitigation_cls, then i ran the VQC algo on rochester backend, a LayoutError: Integer list length must equal number of qubits in circuit is produced.

Steps to reproduce the problem

feature_map=3
vqc = VQC(optimizer, feature_map, var_form, training_input, test_input)
quantum_instance = QuantumInstance(backend, shots=shots, seed_simulator=random_seed, initial_layout=[42,43,44] , measurement_error_mitigation_cls=CompleteMeasFitter, measurement_error_mitigation_shots=4096, seed_transpiler=random_seed, skip_qobj_validation=True)
result = vqc.run(quantum_instance)

What is the expected behavior?

The algorithm shouldn't fail with this initial_layout=[42,43,44]. It only works if we specify all the qubits like: [42,43,44] +list(range(3, 42))+[0,1,2] or if the length of initial_layout list is equal to the number of register qubits of the circuits for measurement error mitigation.

Suggested solutions

The complete_meas_cal method from ignis use qubits from 0 to max(qubit_list). So specify an initial layout as above will produce a terra error because the length of layout is less than the number of qubits used for the error mitigation.
I think, updating the compile_config argument to consider the new initial_layout after the complete_meas_cal will resolve this issue.
https://github.com/Qiskit/qiskit-aqua/blob/997a378cb54c30049fe0d0b7549e86717a46133f/qiskit/aqua/utils/measurement_error_mitigation.py#L116

@woodsp-ibm
Copy link
Member

Hi, would you be able to post the complete script that is failing? We tried on both stable (since you reported 0.6.1 above) and on the latest master and could not reproduce the error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants