feat(simulator): add QuantumState interface and local DensityMatrixSi… - #29
Open
Aditya12313 wants to merge 4 commits into
Open
Aditya12313 wants to merge 4 commits into
Aditya12313 wants to merge 4 commits into
Conversation
…mulator - Add QuantumState abstract base class for state representations - Implement DensityMatrixState and local DensityMatrixSimulator for offline execution - Fix 2D list parsing bug in quantum_info.DensityMatrix._init_from_array - Add comprehensive test suite in tests/test_density_matrix_simulator.py
This file contains hidden or 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
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.
…mulator
Summary
This PR adds a generic
QuantumStateinterface and introduces a localDensityMatrixSimulatorbackend, enabling offline and noisy circuit simulations without cloud dependencies. It also resolves a 2D array parsing bug inquantum_info.DensityMatrix.Key Changes
QuantumStateAbstract Interface (qpiai_quantum/simulator/state.py):DensityMatrixState&DensityMatrixSimulator(qpiai_quantum/simulator/density_matrix.py):pure_state,maximally_mixed), information-theoretic metrics (purity,von_neumann_entropy), and subsystempartial_trace(specifically optimized for 2-level qubit registers).BaseSimulatorinterface, returning standardQasmSimulatorResult.quantum_info.DensityMatrix._init_from_array:_init_from_arrayso 2D numeric and complex nested lists properly initializeself.data.tests/test_density_matrix_simulator.py):quantum_info.DensityMatrixinteroperability.Verification
tests/test_density_matrix_simulator.pyand existing simulator unit tests pass cleanly.