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

Fix measure instruction #167

Merged
merged 5 commits into from
Nov 27, 2023
Merged

Fix measure instruction #167

merged 5 commits into from
Nov 27, 2023

Conversation

rturrado
Copy link
Contributor

Added an instruction_base class to the tree-gen syntactic AST.
This class serves as a base class for instruction and measure_instruction.
A measure_instruction has a lhs operand, and a rhs operand.
The names have been chosen to be similar to v1x assignment instructions.
A measure instruction is kind of an assignment from qubits to bits, with a left hand side expression and a right hand side expression.
These operands can be multi-index, but not lists of expressions.
The current instruction resolver cannot deal yet with instructions accepting a variadic list of arguments.

Removed request_qubit_and_bit_indices_have_same_size member from Instruction.
This check is now implicit for a measure instruction.

parsing.cpp:

  • Updated parameter order when registering a measure instruction.
  • The order is now left to right, bit to qubit.

This class serves as a base class for 'instruction' and 'measure_instruction'.
A 'measure_instruction' has a 'lhs' operand, and a 'rhs' operand.
The names have been chosen to be similar to v1x assignment instructions.
A measure instruction is kind of an assignment from qubits to bits, with a left hand side expression and a right hand side expression.
These operands can be multi-index, but not lists of expressions.
The current instruction resolver cannot deal yet with instructions accepting a variadic list of arguments.

Removed request_qubit_and_bit_indices_have_same_size member from Instruction.
This check is now implicit for a measure instruction.

parsing.cpp:
- Updated parameter order when registering a measure instruction.
- The order is now left to right, bit to qubit.
@rturrado rturrado requested a review from pablolh November 23, 2023 11:45
This is not really part of this PR.
But I saw it yesterday going through the code with Chris, and I take the opportunity to remove it.
src/v3x/BuildTreeGenAstVisitor.cpp Show resolved Hide resolved
@rturrado rturrado merged commit 8c9a3a6 into develop Nov 27, 2023
14 of 15 checks passed
@rturrado rturrado deleted the fix_measure_instruction branch November 27, 2023 13:36
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