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

Efficient Contraction Order Statevector Simulator #92

Open
masa10-f opened this issue Nov 10, 2023 · 5 comments · May be fixed by #114
Open

Efficient Contraction Order Statevector Simulator #92

masa10-f opened this issue Nov 10, 2023 · 5 comments · May be fixed by #114
Assignees
Labels
new feature New feature or request performance performance improvement proposals simulation backend related to numerical simulation backend

Comments

@masa10-f
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The state vector simulator for MBQC inherently exhibits slower performance compared to that for quantum circuits, primarily attributed to two key factors:

  1. MBQC necessitates the utilization of at least one ancillary qubit to proceed computation. This leads to at least a twofold increase in memory consumption, consequently extending the computational time.
  2. In contrast to a gate in a quantum circuit, a single step in MBQC cannot encompass all single-qubit Unitary operations without changing the graph structure. This characteristic augments the size of the computational graph, demanding a higher computational load.

In order to address the aforementioned challenges, Graphix incorporates a minimize_space method designed to mitigate the impact of ancillary qubits on computational efficiency. This method aims to minimize the number of ancillary qubits required simultaneously, enabling Graphix to simulate large-scale MBQC with a comparatively lower computational burden.

However, it is important to note that this approach is constrained to simulating measurement patterns in standardized or NEMC forms, which are prevalent in MBQC. Additionally, it's crucial to acknowledge that the current implementation of the minimize_space method is heuristic. Consequently, it does not guarantee optimal outcomes in all cases, as it may not consistently yield the most efficient solutions.

Describe the feature you'd like
A clear and concise description of what you want to happen.

I propose the implementation of a new simulator backend, the Contraction-wise State Vector Simulator(CW-SVS), into Graphix. The CW-SVS optimizes contraction order by delaying the calculation of outer products until the latest possible stage, leading to a substantial reduction in FLOPs. Importantly, this simulator maintains the same computational capabilities as conventional state vector simulators, as both calculate the same tensor network. The difference is just in contraction order.

The CW-SVS's intelligent contraction order incorporates the minimize_space feature of the Pattern class. This eliminates the need to explicitly consider the order of measurement patterns, enabling the seamless simulation of standardized measurement patterns. We can implement this backend with quimb and slightly modify the current tensornetwork backend.

Furthermore, applying this contraction-wise strategy could extend beyond the state vector simulator. It can be leveraged to enhance density matrix backends and circuit simulators, contributing to a more efficient and versatile computational framework.

Additional context
Add any other context or screenshots about the feature request here.

na

@masa10-f masa10-f added new feature New feature or request simulation backend related to numerical simulation backend performance performance improvement proposals labels Nov 10, 2023
@shinich1
Copy link
Contributor

Nice!

A minor point but what's the reasoning for the name 'contraction-wise simulation'? this '-wise' sounds a bit like doing simulation for every contraction?

Perhaps something like:

  • tensor-based state vector simulation
  • path-flexible state vector simulation
    etc?

@masa10-f
Copy link
Contributor Author

@shinich1
Thank you for your comment!
tensor-based is not what I mean here because the conventional state vector simulator is also a 'tensor-based' simulator.
I wanna express 'perform contraction in clever or smart way' as the only difference is in a contraction order. So, contraction-smart or contraction-clever? What do you think about these?

@shinich1
Copy link
Contributor

shinich1 commented Nov 11, 2023

Indeed conventional sv sim is also tensor-based and as you say, the difference is the increased flexibility of the contraction path. clever or smart may not be a good word for class/method name, let me think of a wording for this

@masa10-f
Copy link
Contributor Author

masa10-f commented Nov 17, 2023

How about "Efficient Contraction Order(ECO) Statevector Simulator"? @shinich1
(ChatGPT suggests this name and it sounds nice to me:))

@shinich1
Copy link
Contributor

@masa10-f sounds good to me!

@masa10-f masa10-f changed the title Contraction-Wise State Vector Simulator Efficient Contraction Order Statevector Simulator Nov 21, 2023
@nabe98 nabe98 self-assigned this Jan 11, 2024
@nabe98 nabe98 linked a pull request Jan 16, 2024 that will close this issue
@shinich1 shinich1 linked a pull request Apr 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request performance performance improvement proposals simulation backend related to numerical simulation backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants