Skip to content

Commit

Permalink
feat: add note to reset and cif
Browse files Browse the repository at this point in the history
  • Loading branch information
beizhansl committed Nov 6, 2023
1 parent 3b3f1d3 commit 03b4b0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion quafu/circuits/quantum_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,11 @@ def delay(self, pos, duration, unit="ns") -> "QuantumCircuit":
def reset(self, qlist:List[int]= None) -> "QuantumCircuit":
"""
Add reset for qubits in qlist.
Args:
qlist (list[int]): A list contain the qubit need add reset. When qlist contain at least two qubit, the barrier will be added from minimum qubit to maximum qubit. For example: barrier([0, 2]) create barrier for qubits 0, 1, 2. To create discrete barrier, using barrier([0]), barrier([2]).
Note: reset only support for simulator `qfvm_circ`.
"""
if qlist is None:
qlist = list(range(self.num))
Expand Down Expand Up @@ -891,6 +893,8 @@ def cif(self, cbits:List[int], condition:int):
with qc.cif(cbits=[0], condition=1):
qc.x(2)
qc.measure([2],[2])
Note: cif only support for simulator `qfvm_circ`.
"""
# check cbits
if not len(set(cbits)) == len(cbits):
Expand Down

0 comments on commit 03b4b0e

Please sign in to comment.