Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Qsearch with qfactor method raises error with model #256

Open
clancyras opened this issue Jul 9, 2024 · 0 comments
Open

Running Qsearch with qfactor method raises error with model #256

clancyras opened this issue Jul 9, 2024 · 0 comments

Comments

@clancyras
Copy link

clancyras commented Jul 9, 2024

An error arises when running the following code:

# backend.num_qubits == 127
model = MachineModel(backend.num_qubits, gate_set=[ECRGate(), RZGate(), SXGate(), XGate(), IdentityGate()])

with Compiler() as compiler:
    partitionWorkFlow = [
        SetModelPass(model), 
        QuickPartitioner(block_size=3), 
        ForEachBlockPass(
           IfThenElsePass(
                WidthPredicate(3), 
                NOOPPass(), 
                QSearchSynthesisPass(instantiate_options={'method': "qfactor", 'multistarts': 4})
            ), 
            replace_filter='less-than-respecting-multi'
        ), 
        UnfoldPass()
    ]

    outputScanCircuit = compiler.compile(circuit, partitionWorkFlow)

The following code fixes this issue:

model = MachineModel(backend.num_qubits, gate_set=[ECRGate(), RZGate(), SXGate(), XGate(), IdentityGate()])

layergen = SimpleLayerGenerator(ECRGate(), VariableUnitaryGate(1))

with Compiler() as compiler:
   # Play around with multistart: 4 or 8
    partitionWorkFlow = [
        SetModelPass(model), 
        QuickPartitioner(block_size=3), 
        ForEachBlockPass(
            IfThenElsePass(
                WidthPredicate(3), 
                NOOPPass(), 
                QSearchSynthesisPass(layer_generator=layergen, instantiate_options={'method': "qfactor", 'multistarts': 4})
            ), 
            replace_filter='less-than-respecting-multi'
        ), 
        UnfoldPass()
    ]

    outputScanCircuit = compiler.compile(circuit, partitionWorkFlow)

Can we figure out a way to avoid specifying the layer generator?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant