-
Notifications
You must be signed in to change notification settings - Fork 12
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
Manage bit (register) variables #155
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Extract DensityUnitaryMatrix, QuantumState, and SparseArray to separate files. Remove include/qx/Common.hpp. Remove src/qx/Core.cpp.
Add QuantumStateError struct. Change SimulationResult to contain Results and States.
Add MapBasisVectorToSparseComplex and VectorOfSparseElements aliases. Add SparseArrayError struct. Move Complex to Core.hpp.
Add bitIndex to Measure instruction. Add bit register size to QuantumState. Add bit measurement register to QuantumState. Add SparseArray.accumulate. Add boost/1.85.0 to conanfile.py. Change OperandsHelper.get_register_operand to work with bit operands. Change GateConvertor.addGates to accept bit indices in a Measure instruction. Refactor QuantumState.measure. Change CMakeLists.txt to work with Boost. Update CHANGELOG.md with minor aesthetic changes. Remove QuantumState.{measureAll, prep}. Remove InstructionExecutor.{MeasureAll, PrepZ}.
…mporarily also measurements). A SimulationResult has a state and a bitRegisterMeasurement (temporarily also measurements). A SimulationResult also has a qubit and a bit register. State is a vector of SuperposedState. Measurements is a vector of Measurement. SuperposedState is a state string and an amplitude. Measurement is a state string and a count. Add SimulationResultAccumulator bitMeasurementRegister member. Add QuantumState constructor receiving an initializer list. Add QuantumState checkQuantumState and isNormalized methods. Add SparseArray constructor receiving an initializer list. Add SparseArray norm method. Add Core isNull(complex) method. Add Core fmt::formatter for BitMeasurementRegister. Rename SimulationResult.results to measurements. Rename SimulationResult.states to state. Extract InstructionExecutor and Instructions to separate files. Remove QuantumState::testInitialize. Remove explicit instantiations of QuantumState::apply<1,2,3>. TODO: bit_measurement_register test.
rturrado
changed the title
Manage bit register variables
Manage bit (register) variables
Jun 18, 2024
Add conan/profiles/base. Add boost/*:header_only=True to conan/profiles/base.
…mplitude_t. Change SimulationResult.bitRegisterMeasuremnents to bitMeasurements. Change SimulationResult.operator<< to print bit measurements, qubit register, and bit register.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
QX simulator now parses bit (register) variables from the libqasm AST.
Apart from that, this PR includes a lot of refactorings.
The RegisterManager now manages a qubit and a bit register.
The SimulationResultAccumulator now has a state and bitMeasurements (temporarily also measurements).
A SimulationResult has a state and a bitRegisterMeasurement (temporarily also measurements).
A SimulationResult also has a qubit and a bit register.
State is a vector of SuperposedState.
Measurements is a vector of Measurement.
SuperposedState is a struct containing a state string and an amplitude.
Measurement is a struct containing a state string and a count.
Add Core/BitMeasurementRegister alias.
Add Core/isNull(complex) function.
Add Core/fmt::formatter for BitMeasurementRegister.
Add Measure.bitIndex member.
Add QuantumState.numberOfBits member.
Add QuantumState.bitRegisterMeasurement member.
Add QuantumState constructor receiving an initializer list.
Add QuantumState.checkQuantumState and isNormalized methods.
Add QuantumState/QuantumStateError struct.
Add SimulationResult/Result and State structs.
Add SparseArray constructor receiving an initializer list.
Add SparseArray.accumulate method.
Add SparseArray.norm method.
Add SparseArray/SparseComplex struct and SparseElement alias.
Add SparseArray/MapBasisVectorToSparseComplex and VectorOfSparseElements aliases.
Add SparseArray/SparseArrayError struct.
Add SimulationResultAccumulator.bitMeasurementRegister member.
Add boost/1.85.0 to conanfile.py.
Change RegisterManager to support a qubit and a bit register.
Change OperandsHelper.get_register_operand to work with bit operands.
Change GateConvertor.addGates to accept bit indices in a Measure instruction.
Change SimulationResult::operator<< to use fmt::print.
Change OUTPUT_DECIMALS to uint8_t.
Change CMakeLists.txt to work with Boost.
Change CHANGELOG.md with minor aesthetic changes.
Extract DensityUnitaryMatrix, QuantumState, and SparseArray to separate files.
Extract InstructionExecutor and Instructions to separate files.
Move Complex to Core.
Refactor QuantumState.measure method.
Rename SimulationResult.results to measurements.
Rename SimulationResult.states to state.
Remove include/qx/Common.hpp.
Remove src/qx/Core.cpp.
Remove InstructionExecutor.{MeasureAll, PrepZ}.
Remove QuantumState.{measureAll, prep} methods.
Remove QuantumState.testInitialize method.
Remove QuantumState.apply<1,2,3> explicit instantiations.
TODO:
Adding this has to be previously agreed with QX simulator clients.
Issue #154: [Code] Manage bit (register) variables.