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

Documenting Pulse concatenation behavior #2

Open
ajkeller34 opened this issue Jan 16, 2017 · 0 comments
Open

Documenting Pulse concatenation behavior #2

ajkeller34 opened this issue Jan 16, 2017 · 0 comments

Comments

@ajkeller34
Copy link
Contributor

Without it being immediately obvious that Pulse <: AbstractMatrix, array concatenation behavior can be a little confusing. Consider the following which could be used to generate a CPMG pulse sequence:

ndelay = 1
npi = 6
sequence = vcat(Xpi2, Idle*ndelay, Ypi, take(cycle([Idle*(2*ndelay), Ypi]), 2*(npi - 1))..., Idle*ndelay, Xpi2)

This gives:

Length-20 pulse sequence:
Xpi2	
Idle	
Ypi	
Idle	
Idle	
Ypi	
Idle	
Idle	
Ypi	
Idle	
Idle	
Ypi	
Idle	
Idle	
Ypi	
Idle	
Idle	
Ypi	
Idle	
Xpi2

If you instead replace [Idle*(2*ndelay), Ypi] with vcat(Idle*(2*ndelay), Ypi):

Length-15 pulse sequence:
Xpi2	
Idle	
Ypi	
Idle	
Idle	
Ypi	
Idle	
Idle	
Ypi	
Idle	
Idle	
Ypi	
Idle	
Idle	
Xpi2

I suggest specifying the expected behavior of hcat, vcat, hvcat, and the various array concatenation shorthands ([a b], [a,b], [a b; c d]) in documentation and perhaps writing some simple tests in test/runtests.jl.

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

No branches or pull requests

1 participant