-
Notifications
You must be signed in to change notification settings - Fork 368
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
Fix required memory checks for QasmSimulator with custom method #763
Merged
chriseclectic
merged 6 commits into
Qiskit:master
from
chriseclectic:fix-validate-memory
Jun 1, 2020
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
52be414
Validate required memory before simulation
chriseclectic 76b3c93
Fix required memory for density matrix state
chriseclectic 6ba62b1
add reno
chriseclectic f3a6331
Merge branch 'master' into fix-validate-memory
chriseclectic 7e2189c
Merge branch 'master' into fix-validate-memory
chriseclectic e8ed725
Merge branch 'master' into fix-validate-memory
chriseclectic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
releasenotes/notes/fix-required-memory-check-0a138e0478d8ff32.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixes issue where memory requirements of simulation were not being checked | ||
on the QasmSimulator when using a non-automatic simulation method. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -352,12 +352,8 @@ template <class densmat_t> | |
size_t State<densmat_t>::required_memory_mb(uint_t num_qubits, | ||
const std::vector<Operations::Op> &ops) | ||
const { | ||
// An n-qubit state vector as 2^n complex doubles | ||
// where each complex double is 16 bytes | ||
(void)ops; // avoid unused variable compiler warning | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not part of your changes, but seeing this line, it makes clear that we need an override of this method. |
||
size_t shift_mb = std::max<int_t>(0, num_qubits + 4 - 20); | ||
size_t mem_mb = 1ULL << shift_mb; | ||
return mem_mb; | ||
return BaseState::qreg_.required_memory_mb(2 * num_qubits); | ||
} | ||
|
||
template <class densmat_t> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I thought this was automatically generated when creating the release?
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.
I thought you still needed these since they have them in Terra, but maybe @mtreinish knows?
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.
Yes this is still needed. The changelog is automated now, but release documentation still needs to be written. The previous changelog was serving double duty as release documentation (frankly quite poorly). See the contributing docs on this: https://github.com/Qiskit/qiskit-aer/blob/master/CONTRIBUTING.md#release-notes (the changelog section above it mentions the changelog autogeneration)