Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noiseaware CSPLayout pass #5075

Closed
wants to merge 13 commits into from

Conversation

czachow
Copy link
Contributor

@czachow czachow commented Sep 16, 2020

Summary

Refactored the class CSPLayout and created a new class derived of CSPLayout which adds noise awareness.

Closes #5052

Details and comments

  • refactored the custom recursive backtracking solver into a separate document
  • refactored the method run of CSPLayout into different methods
  • created a new method called CSPLayoutNoise
  • implemented tests for CSPLayoutNoise

@czachow czachow requested a review from a team as a code owner September 16, 2020 10:44
@czachow

This comment has been minimized.

@1ucian0 1ucian0 changed the title 5052-Created_Noiseaware_CSPLayout Noiseaware CSPLayout pass Sep 17, 2020
@1ucian0
Copy link
Member

1ucian0 commented Sep 28, 2020

It could be nice to have some performance/benchmarking data, if it's not too hard to get.

@czachow
Copy link
Contributor Author

czachow commented Sep 30, 2020

Thanks for your feedback. I took a look into the other layouters and think it is not easy to compare them. Here you find some benchmarking comparison:

As a benchmark I took the problem of simulating the time evolution of an Ising Chain. The calculation was run on ibmq_bogota using three qubits. Three different layouting methods were used and compared to the simulator. At first the classical CSPLayout (dev), the CSPLayoutNoise (dev_ns) as implemented here and a more advanced CSPLayoutAdvancedNoise (dev_avns) as described in slack were used. The circuit is mapped to different physical qubits (0, 1, 2 in case 1 and 2, 3, 4 in the other). The plot shows the probability of measuring the state 111, starting with an initial state of 000 after a certain time. Additionally, the average of five "independent" runs have been taken. This shows that the noise aware versions perform better and are comparable.

compare_csp_layout.pdf

@1ucian0
Copy link
Member

1ucian0 commented Oct 2, 2020

For reference, here is the image in the PDF.
Screen Shot 2020-10-02 at 3 02 36 PM

What about runtime? Is it significantly slower than the plain CSP method?

@czachow
Copy link
Contributor Author

czachow commented Oct 14, 2020

Sorry for the delay.
The difference in runtime strongly depends on the number of solutions S to the layout problem. The additional time complexity can be estimated as the product of the number of gates in the circuit G and the number of solutions found by the crb solver S. I have chosen the same problem as above for an example calculation and averaged over 100 runs of the passmanager. The task is to embed a circuit of three qubits which are only interacting as a chain onto the devices.

This first plot shows the runtime for the ibmq_bogota device for the three different algorithms.
Screenshot 2020-10-14 at 14 21 55

This second plot show the runtime for the ibmq_16_melbourne device for the three different algorithms.
Screenshot 2020-10-14 at 14 21 27

Whereas for the bogota device there is only a small increase, the time increases dramatically for the melbourne device. In my opinion, in a typical setup the number of device and circuit qubits should be approximately equal and thus not that many different possibilities S should arise.

…ut_noiseaware

Merge upstream/master for updated qiskit-terra version.
@1ucian0
Copy link
Member

1ucian0 commented Dec 10, 2020

After some chat with team and OP, we agree with the following:

  • Add a parameter solution_limit as a possible extra limit in the maximum amount of solutions that should be considered. solution_limit=None or solution_limit=0 means "all the solutions". solution_limit=1 has exactly the same effect than current CSPLayout.
  • Merge CSPLayoutNoise and CSPLayout.

@1ucian0 1ucian0 self-assigned this Dec 23, 2020
@1ucian0
Copy link
Member

1ucian0 commented Apr 21, 2021

before this PR, we need to merge #6263. Therefore, on hold

@1ucian0 1ucian0 added the on hold Can not fix yet label Apr 21, 2021
@HuangJunye
Copy link
Collaborator

HuangJunye commented Jan 10, 2022

Just checking, what's the status of this PR? Why isn't it merged? Still waiting for #6263 ?

@czachow
Copy link
Contributor Author

czachow commented Jan 10, 2022

In my opinion this merge request can be closed. As a follow-on of this work we (@1ucian0, @georgios-ts and I) investigated the vf2 method for layout allocation. With merge requests #6620, #7213 and #7276 this has now become a part of qiskit.

@czachow czachow closed this Jan 10, 2022
@HuangJunye
Copy link
Collaborator

Luciano told me about the VF2 Layout work. Nice! Thanks for closing the PR as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold Can not fix yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSPLayout should be noise-aware
3 participants