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

fix: Force StateVector and DensityMatrix values to be ndarrays and test #2

Merged
merged 2 commits into from
May 6, 2024

Conversation

kshyatt-aws
Copy link
Contributor

Issue #, if available: N/A

Description of changes: Convert the raw Python list representation of the state vector/density matrix result to np.ndarray which is expected. Add a test for both IR types.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kshyatt-aws kshyatt-aws requested a review from a team as a code owner May 1, 2024 19:40
Base automatically changed from initial to main May 6, 2024 17:48
src/braket/simulator_v2/simulator.py Outdated Show resolved Hide resolved
@@ -473,6 +496,13 @@ def run_jaqcd(
)
r = jl.simulate(self._device, [circuit_ir], qubit_count, shots)
r.additionalMetadata.action = circuit_ir
if not shots:
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be a dumb question : should we be using _generate_results or _create_results_obj from the default sim?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, those are handled internally by the Julia sim already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the shots=0 case, the expectation values/variances/whatever have already been calculated and populated into GateModelTaskResult.

@kshyatt-aws kshyatt-aws merged commit 95186da into main May 6, 2024
12 checks passed
@kshyatt-aws kshyatt-aws deleted the ksh/array_type branch May 6, 2024 22:51
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