CycleWalk
QuICT.algorithm.quantum_algorithm.quantum_walk.CycleWalk ¶
CycleWalk(node_num: int, shift_op: Optional[CompositeGate] = None, coin_op: Optional[CompositeGate] = None, state_prep: Optional[CompositeGate] = None)
A quantum walk on a cycle graph. Assuming each node and each direction of the coin is encoded as an unsigned binary integer.
Parameters:
-
node_num(int) –total number of node in the cycle graph.
-
shift_op(CompositeGate | None, default:None) –shift operator for the quantum walk. If not given, a default one, S = |x - 1>
<0| + |x + 1> <1|, will be used. -
coin_op(CompositeGate | None, default:None) –coin operator for he quantum walk. If not given, a default Hadamard coin will be used.
-
state_prep(CompositeGate | None, default:None) –quantum gate that initializes the state on the node register.
Source code in QuICT/algorithm/quantum_algorithm/quantum_walk/cycle_walk.py
circuit ¶
Given number of iteration, construct the quantum walk circuit.
Parameters:
-
iteration(int) –Number of walk iteration.
Returns:
-
Circuit(Circuit) –the quantum walk circuit.
Source code in QuICT/algorithm/quantum_algorithm/quantum_walk/cycle_walk.py
run ¶
Run the quantum walk on the cycle graph.
Parameters:
-
iteration(int) –Number of walk iteration.
-
backend(Any, default:StateVectorSimulator()) –Device to run the quantum walk.
-
shots(int, default:1) –Number of experiments to run.
Returns:
-
Dict[str, int]–Dict[str, int]: sampling result on the node register of the quantum walk circuit.