Skip to content

Conversation

Dpbm
Copy link
Contributor

@Dpbm Dpbm commented Sep 4, 2025

Measure all issue in JS version

When we start implementing a quantum circuit, the measure_all function is intended to handle the measurements regardless whether clbits were defined previously.

However, the old implementation was relying in this value being set by the user, and in the measure_all method, it was being check if the value in num_clbits was 0, which was impossible, since it's value is undefined by default.

constructor undefined

Update

Now, a default value 0 is defined for m, ensuring that even when no argument was inserted for clbits, the value is valid.


Tests

I also added some tests, that can be run using node v22.18.0.

npm run test

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.

1 participant