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

[Refactor] Use QuantumCircuit for Expr and user data + embeddings #7

Open
Doomsk opened this issue May 22, 2024 · 0 comments
Open

[Refactor] Use QuantumCircuit for Expr and user data + embeddings #7

Doomsk opened this issue May 22, 2024 · 0 comments
Assignees
Labels

Comments

@Doomsk
Copy link
Member

Doomsk commented May 22, 2024

QuantumCircuit can have as input either an expression (Expr) or user data + embedding function. User data can be any kind of array, graph, etc that contains or encodes relevant data for building a layout for the registers. It could be described as in:

class QuantumCircuit:
    @singledispatchmethod
    def __init__(self, data, **kwargs):
        raise NotImplementedError

    @__init__.register
    def _(self, data: Expr, **_: Any):
        self.circuit = data

    @__init__.register
    def _(self, data: np.ndarray, embedding: Callable):
        self.circuit = embedding(data)

    @__init__.register
    def _(self, data: list, embedding: Callable):
        self.circuit = embedding(data)

    @__init__.register
    def _(self, data: nx.Graph, embedding: Callable):
        self.circuit = embedding(data)
@Doomsk Doomsk self-assigned this May 22, 2024
@Doomsk Doomsk transferred this issue from pasqal-io/qadence2-platforms Jun 7, 2024
@RolandMacDoland RolandMacDoland changed the title Use QuantumCircuit for Expr and user data + embeddings [Refactor] Use QuantumCircuit for Expr and user data + embeddings Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant