qiskit-community / qiskit-metal

Quantum Hardware Design. Open-source project for engineers and scientists to design superconducting quantum devices with ease.
https://qiskit-community.github.io/qiskit-metal/
Apache License 2.0
288 stars 208 forks source link

Route: add "design precision" to the code that generate points #32

Open JeremyDrysdale-ibm opened 3 years ago

JeremyDrysdale-ibm commented 3 years ago

From @marcolincs

What is the feature being requested?

Current code uses math precision for operation but it does not use design precision to determine the points. Will need to "round" points to the design grid. If there are meanders on the route, the left-over length (if any) should be attached to one of the meanders.

What are use cases for this feature?

Consistent precision

marcolincs commented 3 years ago

Documenting: currently the code contains two precision numbers, but it would seem that they both achieve the same thing. We should separate scope of the numbers:

  1. should be used for "mathematic rounding", a private variable that the user can optionally update if they face rounding errors that they want to remove. (this number should be defined in the math files - as it is now, but it is only used in a very small section of the code)
  2. should be used to define the "design grid", which is the resolution to which we should place the shapes vertices. The user must not be allowed to update because this, as this is a hard constraint applied by the design manufacturing requirements. Additionally, this value must equally impact points for every QComponent instance and equally be represented in every renderer. Therefore it should be applied during the make() of the QComponent so that the algorithms can account for that correction into their calculations; for example when trying to match the length of a meander to spec. (this number should be defined in the design class - as it is now, but it is currently applied at rendering)

The first number will normally me a lot smaller than the second number as scaling goes, but it is possible that at this time the two might be comparable. But the main difference is the scope in which they must be used (1. to round algebra/mathematics, and 2. to round vertices of polygons and paths)