-
Notifications
You must be signed in to change notification settings - Fork 211
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
Reformatting Layers #218
Reformatting Layers #218
Conversation
Quick Note on the most recent push: I made the entanglement folder separate and put the previous entanglement gates there along with the Op2 gates. |
for _lyr in _all_layers: | ||
# check the layer has a non-empty name | ||
assert _lyr.name is not None, f"Layer name not defined for {layer}" | ||
layer_name_dict[_lyr.name] = _lyr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dynamically created the layer list here. Note that instead of specifying the dunder all (and therefore needing to rewrite everything again), I just used underscores to indicate not to export the variables.
Another thing to note is that I noticed the previous layer dictionary only had LayerTemplate0s (which is what’s included in the _all_layers). This dictionary, however, is only used in QuantumNode. Perhaps this can be reformatted for different purposes going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, for later reference, some discourse on using underscore versus all: https://stackoverflow.com/questions/44834/what-does-all-mean-in-python
Similar to previous PRs, reformatting the Layers into separate files.