Skip to content

integrate mps state into the backend#6

Merged
zazabap merged 3 commits intomainfrom
feature/multiple_backend
Dec 3, 2025
Merged

integrate mps state into the backend#6
zazabap merged 3 commits intomainfrom
feature/multiple_backend

Conversation

@zazabap
Copy link
Owner

@zazabap zazabap commented Nov 30, 2025

The back end should have multiple options compare to the usual dense state.


Note

Introduce a backend abstraction and execute_on_backend API, implement MPS (tensor-network) backend, and add comprehensive dense/MPS tests; bump to 0.2.4.

  • Core API:
    • Add states::backend::QuantumStateBackend trait for backend-agnostic execution.
    • Add Circuit::execute_on_backend to run circuits on any backend (e.g., State, MpsState).
    • Helper matrix extractors for 1- and 2-qubit gates (extract_single_qubit_matrix, extract_two_qubit_matrix).
  • Backends:
    • Implement QuantumStateBackend for states::State (dense) with matrix-application helpers.
    • Implement QuantumStateBackend for simulators::mps::MpsState with optimized 1/2-qubit ops, SWAP networks for non-adjacent gates, control>target handling, and fallbacks/errors for unsupported 3-qubit/full-matrix cases.
  • Exports:
    • Re-export QuantumStateBackend, MpsConfig, MpsState via prelude.
  • Tests:
    • Consolidate dense-state circuit tests into tests/test_circuits_dense.rs.
    • Add tests/test_circuits_mps.rs covering MPS execution, dense-vs-MPS parity, and edge cases (e.g., control > target); mark unsupported 3-qubit cases with #[ignore].
  • Docs/Version:
    • Bump version to 0.2.4 and update README.md dependency snippet.

Written by Cursor Bugbot for commit 124c07a. This will update automatically on new commits. Configure here.

@zazabap zazabap self-assigned this Nov 30, 2025
@zazabap zazabap added the enhancement New feature or request label Nov 30, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 30

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@zazabap zazabap merged commit f191e9a into main Dec 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments