From a5d47d2744147d39e2586f536b1ecaeaf757545a Mon Sep 17 00:00:00 2001 From: nikhilkhatri Date: Mon, 25 Mar 2024 09:45:32 +0000 Subject: [PATCH] Add pre-parameterised example to GeneralEncoder --- torchquantum/encoding/encodings.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/torchquantum/encoding/encodings.py b/torchquantum/encoding/encodings.py index e73c526e..03010ade 100644 --- a/torchquantum/encoding/encodings.py +++ b/torchquantum/encoding/encodings.py @@ -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):