Modify Fock backend, supporting MCMC measurement#21
Merged
sansiro77 merged 9 commits intoTuringQ:mainfrom Jul 31, 2024
Merged
Conversation
sansiro77
reviewed
Jul 25, 2024
Contributor
sansiro77
left a comment
There was a problem hiding this comment.
Fock后端的measure根据forward输出是unitary、dict、tensor,分成三个
… code with batched ones
sansiro77
reviewed
Jul 25, 2024
Contributor
sansiro77
left a comment
There was a problem hiding this comment.
我对docstring和代码做了些调整,可以再检查一下,再尝试支持处理带batch的初态,然后测试的ipynb别忘了删
sansiro77
reviewed
Jul 25, 2024
Jooyuza
commented
Jul 26, 2024
Fock backend modifed & feature mcmc added
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fockbackend modified and new feature added:Parameter
is_probofforward,forward_fockhas been changed to:is_prob (None or bool, optional): Choices of return type. Set
Noneto return entire unitary matrix,Set
Trueto return probabilities for Fock basis states;Set
Falseto return amplitude dictionary of final state.Default:
NoneReturns:
Union[torch.Tensor, Dict]:
Tensor of unitary matrix(
is_prob = None), Dictionary of final state(is_prob = False),or Dictionary of probabilty distribution(
is_prob = True),of the photonic quantum circuit after applying the
operators.Fockbackend now supports:QumodeCircuitis encoded with batched data,forwardfunction will have a batched return andmeasurefunction will generate batched outcome.Brief notebook demo:"\docs\test_fockbackend_is_prob.ipynb"