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
279 stars 205 forks source link

Globals default options in QComponent #700

Closed marcolincs closed 2 years ago

marcolincs commented 3 years ago

What are the issues this pull addresses?

This PR serves to eliminate the inconsistencies and the missing options.

NOTE: the global options are propagated to everything, including the transmission lines. However transmission lines do not have orientation or pos_y/x, since they anchor to other components. Therefore, inside the QRoute __init__(), I added a piece of code that deletes pos_x/y and orientation options. With this change, if the user calls:

Therefore, either:

  1. we guide the user to always and only use .options to access things. is there a reason we want to give him the other?
  2. we find another way to delete global default options in the individual QComponents (example: a new class property that is called by the class method to obtain the list of what to delete/ignore).
  3. we find another way to force globals to non-routes. For example we could introduce a "QNonRoute" subclass from which all non route qlibrary inherit.....but this options seems to me excessively confounding.
  4. Any other suggestion is warmly welcome, because we need to make this cahnge and we need to define a solid/scalable "how".

Did you add tests to cover your changes (yes/no)?

yes

Did you update the documentation accordingly (yes/no)?

yes

Did you read the CONTRIBUTING document (yes/no)?

yes

ThomasGM4 commented 3 years ago
1. is there a reason we want to give him the other?

A way to see the component options before making an instance of the component.

we find another way to force globals to non-routes. For example we could introduce a "QNonRoute" subclass from which all non route qlibrary inherit.....but this options seems to me excessively confounding.

Although clunky, might be the most straightforward

marcolincs commented 3 years ago

Changes made.

We forgot to discuss one last thing......should we call the option "orientation" or "rotation"? I vote for rotation since it is more industry standard in physical layout design EDA tools. Should we wait next Tue to finalize it? Meanwhile you can review?

priti-ashvin-shah-ibm commented 3 years ago

Changes made.

We forgot to discuss one last thing......should we call the option "orientation" or "rotation"? I vote for rotation since it is more industry standard in physical layout design EDA tools. Should we wait next Tue to finalize it? Should we wait next Tue to finalize it? Meanwhile you can review?

rotation works for me

priti-ashvin-shah-ibm commented 3 years ago

I am OK with either name of orientation or rotation.