# This code snippet defines a method named `_mixture_` in a class.
# The method returns a list of tuples, where each tuple contains the probability and unitary of a gate option.
def _mixture_(self):
# Calculate the probability for each gate option
probability = 1 / len(self.gate_options)
# Get the unitary of each gate option using the cirq.unitary function
unitaries = [cirq.unitary(g) for g in self.gate_options]
# Create a list of tuples containing the probability and unitary for each gate option
result = [(probability, u) for u in unitaries]
# Return the list of tuples
return result
Associated Context | |
---|---|
Type | Code Snippet ( .py ) |
Associated Tags | cirq http://quantumai.google/cirq https://github.com/davidmerwin |
Description | 'No Description Provided' |
Related Links | http://quantumai.google/cirq https://github.com/davidmerwin |
Related People | David Merwin, CIRQ, David Jeffrey Merwin |
Sensitive Information | No Sensitive Information Detected |
Shareable Link | https://davidmerwin.pieces.cloud/?p=de384fa953 |
https://gist.github.com/davidmerwin/61818b9fd8f5217c2be0706be21cab59?permalink_comment_id=4771143#gistcomment-4771143