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

The length of integration weight needs to be a multiple of 4 #133

Open
xueyue-sherry-zhang opened this issue Aug 4, 2022 · 1 comment
Open
Assignees

Comments

@xueyue-sherry-zhang
Copy link
Collaborator

Hello,

When I tried to use ConstantIntegrationWeights (

class ConstantWaveform(Waveform):
) in the config builder and run the simulation, for example,

ro.add( Operation( MeasurePulse( "zero_pulse", [ zero_wf, zero_wf, ], 200, ) .add(DigitalWaveform("ON", [(1,0)])) .add(ConstantIntegrationWeights("integW_cos", 1.0, 0.0, int(1000 / 4))) .add(ConstantIntegrationWeights("integW_sin", 0.0, 1.0, int(1000 / 4))) .add(ConstantIntegrationWeights("integW_minus_sin", 0.0, -1.0, int(1000 / 4))), name='zero' )

I would get the error that

2022-08-04 09:34:29,863 - qm - ERROR - Invalidation ERROR integration [email protected]_minus_sin: Integration weight segment must have a length that is a multiple of 4

I was wondering whether there's a bug or what's the correct way of using it.

Thanks,
Sherry

@tomerfqm
Copy link
Contributor

tomerfqm commented Aug 5, 2022

Hi @xueyue-sherry-zhang!
The ConstantIntegrationWeights class generates integration weights in the form of a list containing a single tuple of the value and duration.
This format of integration weights requires the duration to be in units of ns and a multiple of 4. In your example, the input duration is 250, which is not a multiple of 4, so you see this error in the config validation.

The correct way for your example would be to use the duration of the measurement pulse - 200. Of course, in the general case, the integration weights don't have to match the length of the pulse (in the case of smearing, for example), but nonetheless, they should be a multiple of 4 length. :)

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

3 participants