Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jackaraz committed Sep 6, 2024
1 parent 4d956ba commit 3547fd3
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions qVAE.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,26 @@


class Layer(Operation):
"""Based on StronglyEntangling Layer"""
"""
Based on StronglyEntangling Layer
Args:
inpts (``jnp.array``): data input
weights (``jnp.array``): trainable parameters
wires (``List[int]``): wires that the gates will act on
reupload (``bool``, default ``True``): use data reuploading
rot (``List[Operation]``, default ``None``): composition of parametrised gates
alternate_embedding (``bool``, default ``False``): use alternate embedding
"""

num_wires = AnyWires
grad_method = None

def __init__(
self,
inpts,
weights,
wires,
inpts: jnp.array,
weights: jnp.array,
wires: List[int],
reupload: bool = True,
rot: List[Operation] = None,
alternate_embedding: bool = False,
Expand Down Expand Up @@ -218,7 +228,15 @@ def batch_split(


def get_cost(circuit, optimizer, linear_loss: bool = False, parallelise: bool = False):
"""Construct the cost function"""
"""
Construct the cost function
Args:
circuit: quantum circuit
optimizer: optax optimiser
linear_loss (``bool``, default ``False``): use linear loss i.e. 1-Fidelity
parallelise (``bool``, default ``False``): parallelise over multiple GPU (not properly tested)
"""

def vmap(param):
return jax.vmap(lambda dat: circuit(dat, param), in_axes=0)
Expand Down

0 comments on commit 3547fd3

Please sign in to comment.