You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This TEP proposes the introduction of native qudit circuit support within TensorCircuit. This will enable users to define and manipulate quantum circuits based on qudits (d-level quantum systems) directly, moving beyond the current qubit-centric approach. The aim is to provide a user-friendly and efficient interface for qudit quantum computation, enhancing TensorCircuit's capabilities and broadening its applicability.
Motivation and Scope
Currently, TensorCircuit primarily focuses on qubit-based quantum circuits. While workarounds exist to simulate qudit systems (as demonstrated in the current hacky implementation), these are often less intuitive, and do not fully leverage the elegance of TensorCircuit-NG's interfaces.
This limitation affects users interested in exploring quantum computation beyond qubits, such as:
Quantum algorithms designed for qudits: Certain quantum algorithms are naturally formulated and potentially more efficient using qudits (e.g., some quantum walks, high-dimensional quantum information processing).
Simulation of physical systems with higher-dimensional degrees of freedom: Modeling systems in quantum chemistry or condensed matter physics may benefit from direct qudit representations.
Quantum information theory research: Exploring the theoretical advantages of higher-dimensional quantum systems requires tools for manipulating and simulating qudit circuits.
This TEP aims to address these limitations by providing:
Native qudit circuit representation: A new class, tc.QuditCircuit, will be introduced to represent quantum circuits composed of qudits.
Intuitive user interface: The interface should be consistent with the existing tc.Circuit for qubits, allowing for a smooth transition for users and leveraging existing TensorCircuit functionalities. The target interface is tc.QuditCircuit(n_qudits, d=dimension).
Efficient simulation: Leverage TensorCircuit's tensor network capabilities to ensure efficient simulation of qudit circuits, potentially optimizing for qudit-specific operations. If possible, MPS + Qudit simulation with tc.MPSQuditCircuit interface can also be implemented.
Extensibility: Design the framework to be extensible, allowing for the addition of new qudit gates and functionalities in the future.
The scope of this initial TEP focuses on:
Core QuditCircuit class: Implementing the basic structure and functionalities for defining qudit circuits.
State preparation and measurement: Supporting initialization of qudit states and measurement in computational basis.
Integration with existing TensorCircuit functionalities: Ensuring compatibility with existing TensorCircuit features like automatic differentiation, JIT, and GPU support which should automatically work for a successful implementation.
Usage and Impact
Users will be able to create and manipulate qudit circuits using the tc.QuditCircuit class in a manner analogous to tc.Circuit.
Example Usage:
importtensorcircuitastcimportnumpyasnp# Create a qudit circuit with 3 qudits, dimension d=3n_qudits=3d=3qc=tc.QuditCircuit(n_qudits, d=d)
# Apply a generalized Pauli-X gate on qudit 0qc.x(0) # Generalized X, equivalent to cyclic permutation# Apply a generalized Hadamard gate on qudit 1qc.h(1) # Generalized Hadamard# Apply a controlled-phase gate between qudit 0 (control) and qudit 2 (target)phase=np.exp(1j*np.pi/4)
qc.cphase(0, 2, phase=phase)
# Get the state vector of the qudit circuitstate_vector=qc.state()
# Measure qudit 0 in the computational basismeasurement_result=qc.measure(0)
print(state_vector)
print(measurement_result)
Backward compatibility
Existing code relying on tc.Circuit and many other functions might implicitly assume qubit computations which should be also corrected accordingly for any $d$.
Implementation
Maybe after refactoring Circuit class is just a wrapper for the more genralized QuditCircuit class with $d=2$.
The text was updated successfully, but these errors were encountered:
TEP - Built-in Qudit Circuit Support in TensorCircuit-NG
Author
@refraction-ray
Status
Draft
Created
2025-02-04
Abstract
This TEP proposes the introduction of native qudit circuit support within TensorCircuit. This will enable users to define and manipulate quantum circuits based on qudits (d-level quantum systems) directly, moving beyond the current qubit-centric approach. The aim is to provide a user-friendly and efficient interface for qudit quantum computation, enhancing TensorCircuit's capabilities and broadening its applicability.
Motivation and Scope
Currently, TensorCircuit primarily focuses on qubit-based quantum circuits. While workarounds exist to simulate qudit systems (as demonstrated in the current hacky implementation), these are often less intuitive, and do not fully leverage the elegance of TensorCircuit-NG's interfaces.
This limitation affects users interested in exploring quantum computation beyond qubits, such as:
This TEP aims to address these limitations by providing:
tc.QuditCircuit
, will be introduced to represent quantum circuits composed of qudits.tc.Circuit
for qubits, allowing for a smooth transition for users and leveraging existing TensorCircuit functionalities. The target interface istc.QuditCircuit(n_qudits, d=dimension)
.tc.MPSQuditCircuit
interface can also be implemented.The scope of this initial TEP focuses on:
QuditCircuit
class: Implementing the basic structure and functionalities for defining qudit circuits.Usage and Impact
Users will be able to create and manipulate qudit circuits using the
tc.QuditCircuit
class in a manner analogous totc.Circuit
.Example Usage:
Backward compatibility
Existing code relying on tc.Circuit and many other functions might implicitly assume qubit computations which should be also corrected accordingly for any$d$ .
Implementation
Maybe after refactoring$d=2$ .
Circuit
class is just a wrapper for the more genralizedQuditCircuit
class withThe text was updated successfully, but these errors were encountered: