Skip to content

Provided ansatz

Vu Tuan Hai edited this page Apr 10, 2024 · 2 revisions

We provide more than 30 different ansatzes in sub-module qoop.core.ansatz as functions (num_qubits: int, *kwargs) -> qiskit.QuantumCircuit

from qoop.core import ansatz
wchain_ansatz = ansatz.wchain(3)

We can do anything with it as a qiskit circuit, or put it into QuantumStatePreparation.

from qoop.compilation.qsp import 
qsp = QuantumStatePreparation(
    u=wchain_ansatz,
    target_state=state.w(num_qubits=3).inverse(),
).fit()

Plot it:

wchain_ansatz.draw()

List of ansatz

Name Function Decompose Gate
graph graph None crz
graph-star stargraph None ry, cz
graph-polygon polygongraph None ry, cz
graph-hyper hypergraph None h, ry, cz, ccz
graph-hyper-hadamard hadamard_hypergraph hypergraph ry, cz, ccz
graph-hyper-zxz hypergraph_zxz hypergraph, zxz rx, ry, rz, cz, ccz
cz cz_layer None cz
crx crx_layer None crx
cry cry_layer None cry
crz crz_layer None crz
cnot entangled_layer None cx
rx rx_layer None rx
ry ry_layer None ry
rz rz_layer None rz
zxz zxz_layer rx, rz rx, rz
swap swap_layer None swap
binho binho rx, cry, rz rx, cry, rz
alternating-zxz alternating_ZXZlayer ry, swap ry, swap
chain wchain None cry
chain-cnot wchainCNOT None cx
chain-zxz wchain_zxz chain, zxz cry, rx, rz
chain-cnot-zxz WchainCNOT_zxz chain, zxz cx, rx, rz
zxz-chain-cnot zxz_WchainCNOT zxz, chain cx, rx, rz
alternating walternating None cry
alternating-cnot walternatingCNOT None cx
alternating-zxz walternating_zxz alternating, zxz cry, rx, rz
alternating-cnot-zxz WalternatingCNOT_zxz alternating, zxz cx, rx, rz
zxz-alternating-cnot zxz_WalternatingCNOT zxz, alternating cx, rx, rz
alltoall walltoall None cry
alltoall-cnot alltoallCNOT None cx
alltoall-zxz walltoall_zxz alltoall, zxz cry, rx, rz
alltoall-cnot-zxz WalltoallCNOT_zxz alltoall, zxz cx, rx, rz
zxz-alltoall-cnot zxz_WalltoallCNOT zxz, alltoall cx, rx, rz
ccz random_ccz None cz, ccz
g2 g2 None cz, ry
gn gn cz, ry cz, ry
g2gn g2gn g2, gn cz, ry
g2gnw g2gnw g2, gn, zxz cz, rx, ry, rz
swap-test parallized_swap_test None h, cswap