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

change simpleexpression for equality handling #828

Open
wants to merge 35 commits into
base: feat/linspace_timesweep
Choose a base branch
from

Conversation

Nomos11
Copy link
Collaborator

@Nomos11 Nomos11 commented May 31, 2024

  1. Release a working version that can efficiently translate increments of constant hold commands on HDAWG
  • Test and fix for post != pre dependency state
  • Test and fix for offby one jump back increment
  • Test and fix for resolution dependent jump back
  1. Release a version that generates dynamic stepping through the command table
  2. Release a version that generates linspace playHold commands
  3. Release a version with linspace scaled arbitrary waveforms

Copy link

github-actions bot commented May 31, 2024

Test Results

    6 files  ±  0      6 suites  ±0   4m 42s ⏱️ + 1m 1s
1 112 tests +425    990 ✅ +350   61 💤 +14  23 ❌ +23  38 🔥 +38 
4 372 runs  +250  3 962 ✅ +122  244 💤  - 38  90 ❌ +90  76 🔥 +76 

For more details on these failures and errors, see this check.

Results for commit def9369. ± Comparison against base commit 49d9a2d.

♻️ This comment has been updated with latest results.

@terrorfisch
Copy link
Member

Does SimpleExpression implement the expression protocol? If not we should definitely mention that in the docs.

@Nomos11
Copy link
Collaborator Author

Nomos11 commented Jun 3, 2024

Not an expert there but does not seem so; moving it around was also just to avoid some circular imports at some point (I'm not even sure it's necessary anymore or if I removed such changes again), it can also be moved further.

@terrorfisch
Copy link
Member

This PR has a lot of unrelated changes

@Nomos11
Copy link
Collaborator Author

Nomos11 commented Jun 5, 2024

yes; it's evolved to collecting random changes to merge into some other side branch to work on, not into master; thought that it would not require spamming more PRs for that / just get general feedback on changes

@@ -88,7 +88,16 @@ def get_constant_output_channels(self, input_channels: AbstractSet[ChannelID]) -

class ChainedTransformation(Transformation):
def __init__(self, *transformations: Transformation):
self._transformations = transformations
#avoid nesting also here in init to ensure always flat hierachy?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the job of the function chain_transformations

Copy link
Collaborator Author

@Nomos11 Nomos11 Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes; basically copied over that code since the function instantiates a new ChainedTransformation.
I wasn't sure if ChainedTransformation is called directly anywhere instead of being instantiated with .chain, so I did the check again in the init function. If the class is not supposed to be initialized directly, it could also be removed again.


def _root(self):
return self._stack[0]

def _get_rng(self, idx_name: str) -> range:
return self._get_ranges()[idx_name]

def inner_scope(self, scope: Scope) -> Scope:
def inner_scope(self, scope: Scope, pt_obj: Optional['ForLoopPT']=None) -> Scope:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The program builder should not know about pulse templates. What is the reasoning behind passing this object here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is all hacked in right now to see if anything works with what i intended to do.
reasoning here to keep the glue code out of the pulse_template._internal_create_program

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say things can be done more elegantly once one sees if the desired concepts work at all or a different approach has to be chosen altogether


@dataclass
class LinSpaceArbitraryWaveformIndexed(LinSpaceNodeChannelSpecific):
"""This is just a wrapper to pipe arbitrary waveforms through the system."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is no longer true

Copy link
Collaborator Author

@Nomos11 Nomos11 Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, docstrings are not adjusted atm



@abstractmethod
def _compare_subset_key(self, channel_subset: Set[ChannelID]) -> Hashable:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for this method? The current implementation is worse than hash(wf.get_subset_for_channels(channel_subset)). If we need better subset analysis, we can improve waveform normalization.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was done before the compare_key thing was reworked, i believe.
but your code would take into account channel names, right? this is what i tried to avoid there to just compare potential sample output.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change however is also not relevant for the linspace thing and propagated to the branch from somewhere

@Nomos11 Nomos11 mentioned this pull request Jun 20, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants