Skip to content

Syntax sugar for squin's two qubit pauli channel #341

@david-pl

Description

@david-pl

Currenlty, the wrapper takes a list of exactly 15 parameters, e.g.

@squin.kernel
def main():
    q = squin.qubit.new(2)
    two_qubit_noise = squin.noise.two_qubit_pauli_channel(
        [
            0.036,
            0.007,
            0.035,
            0.022,
            0.063,
            0.024,
            0.006,
            0.033,
            0.014,
            0.019,
            0.023,
            0.058,
            0.0,
            0.0,
            0.064,
        ]
    )
    squin.qubit.apply(two_qubit_noise, q)

This is not very user friendly, especially when you have a lot of 0 values in there. Also, it's easy to make mistakes.

I'd suggest we add syntax sugar that allows passing a dict similar to cirq's error_probabilities in the AsymmetricDepolarizingChannel, so you could just write e.g.

@squin.kernel
def main():
    q = squin.qubit.new(2)
    two_qubit_noise = squin.noise.two_qubit_pauli_channel({'XX': 0.1, 'YY': 0.2, 'ZZ': 0.15})
    squin.qubit.apply(two_qubit_noise, q)

Anything omitted here should default to 0.

Metadata

Metadata

Assignees

Labels

area: SQUINArea: SQUIN representation, transforms, and compilation.area: stdlibArea: standard library related issues.category: enhancementCategory: this is an enhancement of an existing feature.experience: easyExperience: easy difficulty, suitable for newcomers and first contributions.priority: lowPriority: low priority issues and tasks, backlogs, good-to-haves.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions