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

Simplify the structure of CircuitSimulator #225

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Commits on Dec 10, 2023

  1. Avoid expanding all propagators

    Only expand the propagators when it is applied to the states.
    BoxiLi committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    1b88cee View commit details
    Browse the repository at this point in the history
  2. Remove U_list from the properties of CircuitSimulator

    - Remove it from the input parameters, it makes little sense to provide them to the circuit and then do the simulation. If the unitaries are known. it can be trivally multiplied.
    - Remove U_list from the properties of CircuitSimulator. It is generated during the process and the dimensions of the unitaries are not determined. It should not be exposed to the the user.
    BoxiLi committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    a0d89ee View commit details
    Browse the repository at this point in the history
  3. Not generate the unitary during construction

    - The method `_process_ops` was executed during the construction, which could be expensive. This is moved to the first execution of the circuit.
    - Remove some global members from the class to increase the clearity.
    BoxiLi committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    35ab87f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5e6bcd3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6180d89 View commit details
    Browse the repository at this point in the history
  6. Unify some parameter names

    BoxiLi committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    50f1e43 View commit details
    Browse the repository at this point in the history
  7. Make status parameter private

    The parameters that will be updated during the circuit simulation are changed to private.
    BoxiLi committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    7a638b3 View commit details
    Browse the repository at this point in the history
  8. Remove _process_ops

    Move all the calculation related to unitary-state multiplication to _evolve_state.
    BoxiLi committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    2bc0c8d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f9ab129 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e50feed View commit details
    Browse the repository at this point in the history
  11. Use the simulator to compute unitary

    Provide qeye as the input states.
    BoxiLi committed Dec 10, 2023
    Configuration menu
    Copy the full SHA
    d9a2341 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2023

  1. Remove a unused parameter

    BoxiLi committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    e554aa6 View commit details
    Browse the repository at this point in the history
  2. Remove the support of precompute_unitary

    This option computes the full unitary of all the gates, and caches it. It is beneficial if the circuit has a small number of qubits but a very large depth. This is a rare use case.
    
    At the same time, this feature makes the migration to the new efficient circuit evaluation very hard. If the unitary for the circuit is desired, one can just call QubitCircuit.compute_unitary to get the circuit and then apply it to different states.
    BoxiLi committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    e419b91 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2023

  1. Use np.einsum for gate-state multiplication

    Use np.einsum to apply the gate matrix directly on the state vector, instead of expanding it first to the full dimension.
    - The private member self._state will remain a numpy array during the sequential application of gates.
    - If a measurement occurs, the state has to be transformed to a Qobj.
    - Returning the state after each step is removed as it inevitably creates Qobj and creates a copy in v4.
    BoxiLi committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    9e48064 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2024

  1. Apply feedbacks

    BoxiLi committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    55705f1 View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2024

  1. Configuration menu
    Copy the full SHA
    d1bd5bb View commit details
    Browse the repository at this point in the history
  2. lint fix

    BoxiLi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    474884d View commit details
    Browse the repository at this point in the history