-
Notifications
You must be signed in to change notification settings - Fork 206
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
[Tensornet] Support trajectory simulation for unitary mixture noise channels #2520
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
…jectory Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
…nsornetStateCompute) The first one is only needed once for trajectory simulation. Signed-off-by: Thien Nguyen <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
return std::make_pair(probs, mats); | ||
} | ||
|
||
void SimulatorTensorNetBase::applyNoiseChannel( |
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.
This function seems super huge. Can we please modularize the code in it?
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.
Sure, refactored in 7542c74
const std::vector<std::complex<double>> matPauliX{ | ||
{0.0, 0.0}, {1.0, 0.0}, {1.0, 0.0}, {0.0, 0.0}}; | ||
const std::vector<std::complex<double>> matPauliY{ | ||
{0.0, 0.0}, {0.0, 1.0}, {0.0, -1.0}, {0.0, 0.0}}; |
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.
Shouldn't PauliY be {0.0, 0.0}, {0.0, -1.0}, {0.0, 1.0}, {0.0, 0.0}?
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.
@@ -153,6 +153,149 @@ class SimulatorMPS : public SimulatorTensorNetBase { | |||
SimulatorTensorNetBase::applyExpPauli(theta, controls, qubitIds, op); | |||
} | |||
|
|||
/// @brief Sample a subset of qubits | |||
cudaq::ExecutionResult sample(const std::vector<std::size_t> &measuredBits, |
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.
Let's modularize this function as well.
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.
Refactored in d0fc6e7
return counts; | ||
} | ||
|
||
cudaq::observe_result observe(const cudaq::spin_op &ham) override { |
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.
And this too, please.
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.
Refactored in d0fc6e7
Once we modularize the long functions, can we please throw in some unittests? I will go through the PR again once we have the changes. |
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <[email protected]>
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <[email protected]>
Thanks. I added a new unit test for the matrix representation bug that is not detectable by |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Description
(1) Add support for
cutensornetStateApplyUnitaryChannel
Perform trajectory-based simulation if there are noise ops applied to the state.
Throw error if seeing non-unitary noise ops.
MPS has a custom implementation (override) for trajectory sample/observe as it needs to recompute the state for each trajectory.
Enable noise tests for tensornet backends.
(2) Some minor updates to tensornet backends
Replace a couple of deprecating enums.
Make the number of hyper samples a configuration param and add the corresponding doc.