未验证 提交 907e455d 编写于 作者: Y yangguohao 提交者: GitHub

Update circuit.py

上级 f43b4d97
...@@ -60,6 +60,15 @@ class UAnsatz: ...@@ -60,6 +60,15 @@ class UAnsatz:
# Record history of adding gates to the circuit # Record history of adding gates to the circuit
self.__history = [] self.__history = []
def expand(self,new_n):
"""
为原来的量子电路进行比特数扩展
Args:
new_n(int):扩展后的量子比特数
"""
self.n = new_n
def __add__(self, cir): def __add__(self, cir):
r"""重载加法 ‘+’ 运算符,用于拼接两个维度相同的电路 r"""重载加法 ‘+’ 运算符,用于拼接两个维度相同的电路
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册