Skip to content

[Docs]: The pytket encoder/decoder needs better docs #1434

@aborgna-q

Description

@aborgna-q

Documentation Type

Missing documentation

Documentation Location

tket::serialize::pytket docs

Issue Description

Some broken / confusing encoder / decoder docs:

  • /// Encode a HUGR operation using the registered custom encoders.
    ///
    /// Returns `true` if the operation was successfully converted and no further
    /// encoders should be called.
    Mentions encoding, should be decoding?
  • /// operation and add it to the pytket decoder.
    ///
    /// Returns an [`DecodeStatus`] indicating if the operation was successfully
    /// converted. If the operation is not supported by the decoder, it's
    /// important to **not** modify the `decoder` context as that may invalidate
    /// the context for other decoders that may be called afterwards.
    ///
    /// `op` will always have one of the [`tket_json_rs::OpType`]s specified in
    /// [`PytketDecoder::op_types`].
    fn op_to_hugr<'h>(
    &self,
    First paragraph also seems like it references encoding, but not sure?
  • /// Add a tket1 [`circuit_json::Command`] from the serial circuit to the
    /// decoder.
    Mentions tket1 instead of pytket (mentioned everywhere else afaik), and as a driveby could (probably) fit on a single line

And as you said it may be useful to have a more general intro to the encoder / decoder framework.

Suggested Improvement

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions