Skip to content

Dynamic code properties #18

Description

@quantumgizmos

It would be nice to have functionality whereby codes can be constructed one stabilizer/qubit at a time. e.g.

qcode = StabilizerCode()
qcode.add_stabilizer(00001111)
qcode.add_stabilizer(11110000)

The code's properties will change as stabilizers are added. How can make sure that the code properties are updated dynamically?

Solution 1 (Slow)

Add a method StabilizerCode.update_code_attributes() every time a new stabilizer is added.

  • This would get quite slow if we are adding 1000s of stabilizers.

Solution 2 (Faster)

  • Make all current attributes private.
  • Write getters for each attributes.
  • Set a paramters _code_state_changed: bool
  • Each @Property getter should check whether _code_state_changed is set to true. If yes, then the update_code_params function should be called.

Please any other ideas you might have...

@LiamVS99 @noszitomi

Metadata

Metadata

Assignees

Labels

No labels
No labels

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions