Skip to content

Commit

Permalink
Add pre-parameterised example to GeneralEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilkhatri committed Mar 25, 2024
1 parent e2b190f commit a5d47d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions torchquantum/encoding/encodings.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ class GeneralEncoder(Encoder, metaclass=ABCMeta):
{'input_idx': [12, 13, 14], 'func': 'u3', 'wires': [3]},
{'input_idx': [15], 'func': 'u1', 'wires': [3]},
]
Example 3:
[
{'params': [0.25], 'func': 'rx', 'wires': [0]},
{'params': [0.25], 'func': 'rx', 'wires': [1]},
{'params': [0.25], 'func': 'rx', 'wires': [2]},
{'params': [0.25], 'func': 'rx', 'wires': [3]},
{'input_idx': [0], 'func': 'ry', 'wires': [0]},
{'input_idx': [1], 'func': 'ry', 'wires': [1]},
{'input_idx': [2], 'func': 'ry', 'wires': [2]},
{'input_idx': [3], 'func': 'ry', 'wires': [3]}
]
"""

def __init__(self, func_list):
Expand Down

0 comments on commit a5d47d2

Please sign in to comment.