Skip to content

Commit

Permalink
Ok at least running into the initial errors
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed Oct 18, 2024
1 parent 8ac9219 commit f47d74a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

# All the imports we will need throughout this flows.

# +
# We begin by importing a parametric circuit from `gdsfactory`:
import hdl21 as h
import numpy as np
Expand All @@ -26,9 +25,6 @@
straight_heater_metal_simple,
)


# -

# First, let's set up the filesystem in the directory in which all our files will be generated and stored. This is really an extension of a full mixed-signal design compatible with the tools supported by `piel`.

current_example_directory = piel.return_path(".")
Expand Down Expand Up @@ -116,6 +112,7 @@ def create_switch_fabric():
chain_fock_state_transitions = piel.flows.get_state_phase_transitions(
circuit_component=chain_3_mode_lattice_circuit,
models=optical_logic_verification_models,
switch_states=[0, np.pi],
mode_amount=3,
target_mode_index=2,
)
Expand Down
21 changes: 13 additions & 8 deletions piel/flows/electro_optic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import jax.numpy as jnp # TODO add typing
import logging
from itertools import product
from typing import Optional, Callable, Any
from ..types import (
Expand All @@ -23,6 +24,8 @@
from ..models.frequency.defaults import get_default_models
from ..integration.thewalrus_qutip import fock_transition_probability_amplitude

logger = logging.getLogger(__name__)


def compose_phase_address_state(
switch_instance_map: dict,
Expand Down Expand Up @@ -196,7 +199,7 @@ def calculate_classical_transition_probability_amplitudes(
)
else:
classical_transition_target_mode_probability = None
print(
logger.debug(
ValueError(
"No target mode index provided and no method to determine it. Will continue."
)
Expand Down Expand Up @@ -298,6 +301,8 @@ def compose_network_matrix_from_models(
switch_fabric_switch_phase_configurations = dict()
switch_amount = len(switch_instance_list_i)
switch_instance_valid_phase_configurations_i = []
logger.debug("switch_states")
logger.debug(switch_states)
for phase_configuration_i in product(switch_states, repeat=switch_amount):
switch_instance_valid_phase_configurations_i.append(phase_configuration_i)

Expand Down Expand Up @@ -495,13 +500,13 @@ def generate_s_parameter_circuit_from_photonic_circuit(
netlist[specific_model_key],
models=models,
)
print("Error in generating S-parameters. Check the following:")
print("Required measurement for the top-level circuit:")
print(required_models)
print("Required measurement for the specific model:")
print(specific_model_key)
print("Required measurement for the specific model:")
print(specific_model_required)
logger.error("Error in generating S-parameters. Check the following:")
logger.error("Required measurement for the top-level circuit:")
logger.error(required_models)
logger.error("Required measurement for the specific model:")
logger.error(specific_model_key)
logger.error("Required measurement for the specific model:")
logger.error(specific_model_required)

raise e

Expand Down

0 comments on commit f47d74a

Please sign in to comment.