Skip to content

Allow different spins to have different lengths #9

@fretchen

Description

@fretchen

Suppose the following circuit:

qc = QuantumCircuit(2)
qc.lx(np.pi, [0])

qc.append(LxLyGate(gamma=np.pi), [0, 1])
qc.measure_all()
counts = backend.run(qc, spin=1/2).result().get_counts()

To implement a number of mixture experiments it would be necessary to set the length of each individual spin, which would modify the last line too:

qc = QuantumCircuit(2)
qc.lx(np.pi, [0])

qc.append(LxLyGate(gamma=np.pi), [0, 1])
qc.measure_all()
counts = backend.run(qc, spin=[5, 1/2]).result().get_counts()

No idea which part of the code has to be changed for that and if it is even possible right now. An approach that would be actually nicely compatible with the terminology of the fermions and experimental sequences would be the definition of load gates.

qc = QuantumCircuit(2)
qc.load(4,0)
qc.load(1,1)
qc.lx(np.pi, [0])

qc.append(LxLyGate(gamma=np.pi), [0, 1])
qc.measure_all()
counts = backend.run(qc).result().get_counts()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions