tket
tket copied to clipboard
Make the use of python properties/getters more consistent
For instance, Circuit.n_gates is a property while Circuit.n_2qb_gates and Circuit.n_1qb_gates are methods. I'm also not sure whether Circuit.depth should be a method or a property.
I also spotted this recently. For me it would make sense to have all of these as properties as they are all characteristics of the Circuit object itself.
I'd agree with having them as properties! * Seyon's suggestion for methods makes more sense
I would actually advocate for make them all methods - they all require computation, some of them non-trivial, having then as methods makes that clear.
However...this is an API breaking change, one I don't think is important enough to break API contract. @cqc-alec what do you think?
if we're going with methods we could go with Circuit.get_metric() perhaps?
The word 'get' seems to communicate that it is a method that calculates something rather than a property.
Yeah I don't think we should break the API for this. We could introduce new methods though, with names prefixed by get_ as Callum suggests.
This issue has been automatically marked as stale.
No specific action here; closing until we have a better idea of enhanced API.