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

Implement constructor function for alternating layer ansatz #532

Closed
ducthanh1991 opened this issue Aug 12, 2024 · 6 comments
Closed

Implement constructor function for alternating layer ansatz #532

ducthanh1991 opened this issue Aug 12, 2024 · 6 comments
Assignees
Labels
feature New feature or request

Comments

@ducthanh1991
Copy link
Contributor

Hello,

Have you considered implementing a function to construct the alternating layer ansatz defined in the papers of Nakaji et al. and Cerezo et al. that would be similar to the existing hea function of the module qadence.constructors.ansatze?

@chMoussa
Copy link
Collaborator

chMoussa commented Aug 19, 2024

Hi @ducthanh1991, we have not considered until you asked. It is probably a matter of changing slightly the support where a layer is applied with modulo repetitions, right?

@ducthanh1991
Copy link
Contributor Author

ducthanh1991 commented Aug 20, 2024

Hello @chMoussa,

Yes, I guess that one would need to specify all the same parameters as for the hea function plus one additional parameter for the size of the support of the "local" block in the alternating layer ansatz.

something like:

ansatz = alt_digital(
        depth=`4,
        n_qubits=12,
        m_qubits_block=4,
        operations=[RX],
        entangler=CNOT,
        )
display(ansatz,size="15,15")

would yield:
image

@chMoussa chMoussa added the feature New feature or request label Aug 21, 2024
@chMoussa chMoussa self-assigned this Aug 21, 2024
@chMoussa
Copy link
Collaborator

Hello @chMoussa,

Yes, I guess that one would need to specify all the same parameters as for the hea function plus one additional parameter for the size of the support of the "local" block in the alternating layer ansatz.

something like:

ansatz = alt_digital(
        depth=`4,
        n_qubits=12,
        m_qubits_block=4,
        operations=[RX],
        entangler=CNOT,
        )
display(ansatz,size="15,15")

would yield: image

Ok I will see what is possible to do with the current implementation, unless you already have something on your side?

@ducthanh1991
Copy link
Contributor Author

Hello @chMoussa,

Yes I do have something that I wrote. I'll work on it during the weekend and make a pull request.

@ducthanh1991
Copy link
Contributor Author

Hi @chMoussa,

I have created the pull request #565. Could you take a look?

@chMoussa
Copy link
Collaborator

Closes with #565

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

No branches or pull requests

2 participants