Skip to content

Allow for different sizes in input units for symbolic/unfolded representations #372

@adrianjav

Description

@adrianjav

If we try to create a symbolic circuit containing a Kronecker layer whose input units have different dimensionality, the current implementation throws an exception after checking that these sizes are different.

The problem is the code below, which seems to be a stub remaining from when there was no distinction between symbolic and compiled circuits.

if any(sl.num_input_units != num_units for num_units in sl_ins_units):
raise ValueError(
f"{sl}: expected number of input units {sl.num_input_units}, "
f"but found input layers {sl_ins}"
)

The symbolic Circuit should construct the circuit without issues. The check should therefore be done at compilation time as it is a limitation of the current torch backend and the way folding is handled at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions