-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement term handling & docs #36
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.
A more thorough docs review can follow later
@@ -395,6 +395,402 @@ fn make_py_bit_term(py: Python) -> PyResult<Py<PyType>> { | |||
Ok(obj.downcast_into::<PyType>()?.unbind()) | |||
} | |||
|
|||
/// An observable over Pauli bases that stores its data in a qubit-sparse format. |
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.
Should we remove this docstring from the pure Rust version? Or do you want it duplicated entirely?
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.
We should strip it and adjust it to Rust. It currently contains a lot of Python-specific statements.
indices: Vec<u32>, | ||
bit_terms: Vec<BitTerm>, |
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.
indices: Vec<u32>, | |
bit_terms: Vec<BitTerm>, | |
indices: IndexVec, | |
bit_terms: BitTermVec, |
Or do you see a reason not to do this?
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.
IndexVec & BitTermVec
are removed now
/// | ||
#[no_mangle] | ||
#[cfg(feature = "cbinding")] | ||
pub extern "C" fn pauli_deallocate(pauli: &mut PauliTerm) { |
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.
pub extern "C" fn pauli_deallocate(pauli: &mut PauliTerm) { | |
pub extern "C" fn pauli_free(pauli: &mut PauliTerm) { |
I recall you mentioned wanting to rename these functions like so, no?
num_failed += RUN_TEST(test_mult_real); | ||
num_failed += RUN_TEST(test_mult_complex); | ||
num_failed += RUN_TEST(test_mult); | ||
fflush(stderr); |
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 think you accidentally moved this line up
fflush(stderr); |
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.
yeah I was trying to get C's printf
to print interleaved with calls to Rust's println
but that didn't work... I'll revert 🙂
num_failed += RUN_TEST(test_canonicalize); | ||
num_failed += RUN_TEST(test_copy); | ||
num_failed += RUN_TEST(test_num_terms); | ||
num_failed += RUN_TEST(test_num_qubits); | ||
num_failed += RUN_TEST(test_custom_build); | ||
num_failed += RUN_TEST(test_term); | ||
|
||
fprintf(stderr, "=== Number of failed subtests: %i\n", num_failed); |
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.
fprintf(stderr, "=== Number of failed subtests: %i\n", num_failed); | |
fprintf(stderr, "=== Number of failed subtests: %i\n", num_failed); | |
fflush(stderr); |
Summary