-
Notifications
You must be signed in to change notification settings - Fork 621
Qsim upgrade #445
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
Qsim upgrade #445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick code consistency change, then LGTM :)
State scratch = StateSpace(largest_nq, tfq_for).CreateState(); | ||
Simulator sim = Simulator(tfq_for); | ||
StateSpace ss = StateSpace(tfq_for); | ||
auto sv = StateSpace(tfq_for).Create(largest_nq); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create(unsigned num_qubits)
returns a Vector with freshly allocated memory, so no need to call StateSpace(tfq_for)
again, rather can just use ss
for these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
a feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix ASAN error.
cc: @95-orion-martin , @we-taper
Finishes step 1 in #422
Thematically speaking only a couple of renames and argument movements.
StateSpace
now containsVectorSpace
.CreateState
->Create
and StateSpaces and Simulators no longer have qubit size associated with them so we don't have to create new StateSpace and Simulator objects everytime a state vector size changed.