Skip to content

Documenting Pulse concatenation behavior #2

Description

@ajkeller34

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions