Skip to content

Conversation

MichaelBroughton
Copy link
Collaborator

@MichaelBroughton MichaelBroughton commented Dec 4, 2020

cc: @95-orion-martin , @we-taper

Finishes step 1 in #422

Thematically speaking only a couple of renames and argument movements.
StateSpace now contains VectorSpace.
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.

Copy link
Contributor

@zaqqwerty zaqqwerty left a 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);
Copy link
Contributor

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

Copy link
Collaborator Author

@MichaelBroughton MichaelBroughton Dec 7, 2020

Choose a reason for hiding this comment

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

Fixed.

zaqqwerty
zaqqwerty previously approved these changes Dec 7, 2020
Copy link
Contributor

@zaqqwerty zaqqwerty left a comment

Choose a reason for hiding this comment

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

LGTM

@MichaelBroughton MichaelBroughton merged commit 3a5855d into master Dec 7, 2020
@MichaelBroughton MichaelBroughton deleted the qsim_upgrade branch December 7, 2020 21:00
jaeyoo pushed a commit to jaeyoo/quantum that referenced this pull request Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants