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

Updated Unitary calculator following new code generation style. #264

Merged
merged 3 commits into from
Jan 19, 2021

Conversation

MichaelBroughton
Copy link
Collaborator

Updates unitary calculator to use the same style of code in the rest of the library. Hopefully when #227 is resolved, support for unitary calculator can be included more long term :). This is the first step in resolving #263 .

@google-cla google-cla bot added the cla: yes Override CLA status to unblock PR. label Jan 19, 2021
@MichaelBroughton MichaelBroughton added the kokoro:run Trigger Kokoro builds for this PR. label Jan 19, 2021
@qsim-qsimh-bot qsim-qsimh-bot removed the kokoro:run Trigger Kokoro builds for this PR. label Jan 19, 2021
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

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

Looks good modulo some variable names. Is my understanding correct that the changes between simulator_basic and this code are due to manipulating a vector vs. the unitary matrix?

lib/unitary_calculator_basic.h Outdated Show resolved Hide resolved
lib/unitary_calculator_basic.h Outdated Show resolved Hide resolved
@MichaelBroughton
Copy link
Collaborator Author

MichaelBroughton commented Jan 19, 2021

Is my understanding correct that the changes between simulator_basic and this code are due to manipulating a vector vs. the unitary matrix?

Yes. The unitary calculator is just like the state vector simulators with two major changes:

  1. Larger underlying array (grows like 2^n * 2^n instead of 2^n)
  2. The indexing routines and gate application logic have to account for the row and column when applying the gate instead of just the one long row (or column) that is done in the state vector simulator.

@95-martin-orion 95-martin-orion added the kokoro:run Trigger Kokoro builds for this PR. label Jan 19, 2021
@qsim-qsimh-bot qsim-qsimh-bot removed the kokoro:run Trigger Kokoro builds for this PR. label Jan 19, 2021
@95-martin-orion 95-martin-orion merged commit 59214ae into quantumlib:master Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Override CLA status to unblock PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants