qujax Logo
1.1.0

Documentation:

  • Getting started
  • Examples
  • List of gates

API Reference:

  • Pure state simulation
    • all_zeros_statetensor
    • apply_gate
    • get_params_to_statetensor_func
    • get_params_to_unitarytensor_func
    • get_statetensor_to_expectation_func
    • get_statetensor_to_sampled_expectation_func
  • Mixed state simulation
    • all_zeros_densitytensor
    • kraus
    • get_params_to_densitytensor_func
    • partial_trace
    • get_densitytensor_to_expectation_func
    • get_densitytensor_to_sampled_expectation_func
    • densitytensor_to_measurement_probabilities
    • densitytensor_to_measured_densitytensor
    • statetensor_to_densitytensor
  • Utility functions
    • bitstrings_to_integers
    • check_circuit
    • integers_to_bitstrings
    • print_circuit
    • repeat_circuit
    • sample_bitstrings
    • sample_integers

Links:

  • GitHub
  • Paper
  • PyPI
  • pytket-qujax
qujax
  • Utility functions
  • print_circuit
  • View page source

print_circuit

qujax.print_circuit(gate_seq, qubit_inds_seq, param_inds_seq, n_qubits=None, qubit_min=0, qubit_max=inf, gate_ind_min=0, gate_ind_max=inf, sep_length=1)

Returns and prints basic string representation of circuit.

Parameters:
  • gate_seq (Sequence[str | Array | Callable[[Array], Array] | Callable[[], Array] | Iterable[str | Array | Callable[[Array], Array] | Callable[[], Array]]]) – Sequence of gates. Each element is either a string matching an array or function in qujax.gates, a unitary array (which will be reshaped into a tensor of shape (2,2,2,…) ) or a function taking parameters and returning gate unitary in tensor form. Or alternatively a sequence of the above representing Kraus operators.

  • qubit_inds_seq (Sequence[Sequence[int]]) – Sequences of qubits (ints) that gates are acting on.

  • param_inds_seq (Sequence[Sequence[int]]) – Sequence of parameter indices that gates are using, i.e. [[0], [], [5, 2]] tells qujax that the first gate uses the first parameter, the second gate is not parameterised and the third gates used the fifth and second parameters.

  • n_qubits (int | None) – Number of qubits, if fixed.

  • qubit_min (int | None) – Index of first qubit to display.

  • qubit_max (int | None) – Index of final qubit to display.

  • gate_ind_min (int | None) – Index of gate to start circuit printing.

  • gate_ind_max (int | None) – Index of gate to stop circuit printing.

  • sep_length (int | None) – Number of dashes to separate gates.

Returns:

String representation of circuit

Return type:

List[str]


© Copyright 2023, The qujax authors.

Built with Sphinx using a theme provided by Read the Docs.