text:
#include "DriverSample.h"

#define DISPLAY_ONLY_MY_ITEM  0x0000

EFI_GUID   mFormSetGuid = FORMSET_GUID;
EFI_GUID   mInventoryGuid = INVENTORY_GUID;

CHAR16     VariableName[] = L"MyIfrNVData";

EFI_DRIVER_ENTRY_POINT (DriverSampleInit)

VOID
EncodePassword (
  IN  CHAR16                      *Password,
  IN  UINT8                       MaxSize
  )
{
  UINTN   Index;
  UINTN   Loop;
  CHAR16  *Buffer;
  CHAR16  *Key;

  Key     = L"MAR10648567";
  Buffer  = EfiLibAllocateZeroPool (MaxSize);
  ASSERT (Buffer != NULL);

  for (Index = 0; Key[Index] != 0; Index++) {
    for (Loop = 0; Loop < (UINT8) (MaxSize / 2); Loop++) {
      Buffer[Loop] = (CHAR16) (Password[Loop] ^ Key[Index]);
    }
  }

  EfiCopyMem (Password, Buffer, MaxSize);

  gBS->FreePool (Buffer);
  return ;
}

EFI_STATUS
ValidatePassword (
  DRIVER_SAMPLE_PRIVATE_DATA      *PrivateData,
  EFI_STRING_ID                   StringId
  )
{
  EFI_STATUS                      Status;
  UINTN                           Index;
  UINTN                           BufferSize;
  CHAR16                          *Password;
  CHAR16                          *EncodedPassword;
  BOOLEAN                         OldPassword;

  //
  // Get encoded password first
  //
  BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
  Status = gRT->GetVariable (
                  VariableName,
                  &mFormSetGuid,
                  NULL,
                  &BufferSize,
                  &PrivateData->Configuration
                  );
  if (EFI_ERROR (Status)) {
    //
    // Old password not exist, prompt for new password
    //
    return EFI_SUCCESS;
  }

  OldPassword = FALSE;
  //
  // Check whether we have any old password set
  //
  for (Index = 0; Index < 20; Index++) {
    if (PrivateData->Configuration.WhatIsThePassword2[Index] != 0) {
      OldPassword = TRUE;
      break;
    }
  }
  if (!OldPassword) {
    //
    // Old password not exist, return EFI_SUCCESS to prompt for new password
    //
    return EFI_SUCCESS;
  }

  //
  // Get user input password
  //
  BufferSize = 21 * sizeof (CHAR16);
  Password = EfiLibAllocateZeroPool (BufferSize);
  ASSERT (Password != NULL);

  Status = IfrLibGetString (PrivateData->HiiHandle[0], StringId, Password, &BufferSize);
  if (EFI_ERROR (Status)) {
    gBS->FreePool (Password);
    return Status;
  }

  //
  // Validate old password
  //
  EncodedPassword = EfiLibAllocateCopyPool (21 * sizeof (CHAR16), Password);
  ASSERT (EncodedPassword != NULL);
  EncodePassword (EncodedPassword, 20 * sizeof (CHAR16));
  if (EfiCompareMem (EncodedPassword, PrivateData->Configuration.WhatIsThePassword2, 20 * sizeof (CHAR16)) != 0) {
    //
    // Old password mismatch, return EFI_NOT_READY to prompt for error message
    //
    Status = EFI_NOT_READY;
  } else {
    Status = EFI_SUCCESS;
  }

  gBS->FreePool (Password);
  gBS->FreePool (EncodedPassword);

  return Status;
}

EFI_STATUS
SetPassword (
  DRIVER_SAMPLE_PRIVATE_DATA      *PrivateData,
  EFI_STRING_ID                   StringId
  )
{
  EFI_STATUS                      Status;
  UINTN                           BufferSize;
  CHAR16                          *Password;
  DRIVER_SAMPLE_CONFIGURATION     *Configuration;

  //
  // Get Buffer Storage data from EFI variable
  //
  BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
  Status = gRT->GetVariable (
                  VariableName,
                  &mFormSetGuid,
                  NULL,
                  &BufferSize,
                  &PrivateData->Configuration
                  );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Get user input password
  //
  Password = &PrivateData->Configuration.WhatIsThePassword2[0];
  EfiZeroMem (Password, 20 * sizeof (CHAR16));
  Status = IfrLibGetString (PrivateData->HiiHandle[0], StringId, Password, &BufferSize);
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Retrive uncommitted data from Browser
  //
  BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
  Configuration = EfiLibAllocateZeroPool (sizeof (DRIVER_SAMPLE_PRIVATE_DATA));
  ASSERT (Configuration != NULL);
  Status = GetBrowserData (&mFormSetGuid, VariableName, &BufferSize, (UINT8 *) Configuration);
  if (!EFI_ERROR (Status)) {
    //
    // Update password's clear text in the screen
    //
    EfiCopyMem (Configuration->PasswordClearText, Password, 20 * sizeof (CHAR16));

    //
    // Update uncommitted data of Browser
    //
    BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
    Status = SetBrowserData (
               &mFormSetGuid,
               VariableName,
               BufferSize,
               (UINT8 *) Configuration,
               NULL
               );
  }
  gBS->FreePool (Configuration);

  //
  // Set password
  //
  EncodePassword (Password, 20 * sizeof (CHAR16));
  Status = gRT->SetVariable(
                  VariableName,
                  &mFormSetGuid,
                  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                  sizeof (DRIVER_SAMPLE_CONFIGURATION),
                  &PrivateData->Configuration
                  );
  return Status;
}

EFI_STATUS
LoadNameValueNames (
  IN DRIVER_SAMPLE_PRIVATE_DATA      *PrivateData
  )
/*++

  Routine Description:
    Update names of Name/Value storage to current language.

  Arguments:
    PrivateData - Points to the driver private data.

  Returns:
    EFI_SUCCESS - All names are successfully updated.
    Others      - Failed to get Name from HII database.

--*/
{
  UINTN      Index;
  UINTN      BufferSize;
  EFI_STATUS Status;

  //
  // Get Name/Value name string of current language
  //
  for (Index = 0; Index < NAME_VALUE_NAME_NUMBER; Index++) {

    BufferSize = NAME_VALUE_MAX_STRING_LEN * sizeof (CHAR16);
    Status = IfrLibGetString (
               PrivateData->HiiHandle[0],
               PrivateData->NameStringId[Index],
               PrivateData->NameValueName[Index],
               &BufferSize
               );
    if (EFI_ERROR (Status)) {
      return Status;
    }
  }

  return EFI_SUCCESS;
}

EFI_STATUS
EFIAPI
ExtractConfig (
  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
  IN  CONST EFI_STRING                       Request,
  OUT EFI_STRING                             *Progress,
  OUT EFI_STRING                             *Results
  )
/*++

  Routine Description:
    This function allows a caller to extract the current configuration for one
    or more named elements from the target driver.

  Arguments:
    This       - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
    Request    - A null-terminated Unicode string in <ConfigRequest> format.
    Progress   - On return, points to a character in the Request string.
                 Points to the string's null terminator if request was successful.
                 Points to the most recent '&' before the first failing name/value
                 pair (or the beginning of the string if the failure is in the
                 first name/value pair) if the request was not successful.
    Results    - A null-terminated Unicode string in <ConfigAltResp> format which
                 has all values filled in for the names in the Request string.
                 String to be allocated by the called function.

  Returns:
    EFI_SUCCESS           - The Results is filled with the requested values.
    EFI_OUT_OF_RESOURCES  - Not enough memory to store the results.
    EFI_INVALID_PARAMETER - Request is NULL, illegal syntax, or unknown name.
    EFI_NOT_FOUND         - Routing data doesn't match any storage in this driver.

--*/
{
  EFI_STATUS                       Status;
  UINTN                            BufferSize;
  DRIVER_SAMPLE_PRIVATE_DATA       *PrivateData;
  EFI_HII_CONFIG_ROUTING_PROTOCOL  *HiiConfigRouting;
  EFI_STRING                       Value;
  UINTN                            ValueStrLen;
  CHAR16                           BackupChar;

  PrivateData = DRIVER_SAMPLE_PRIVATE_FROM_THIS (This);
  HiiConfigRouting = PrivateData->HiiConfigRouting;

  //
  // Get Buffer Storage data from EFI variable
  //
  BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
  Status = gRT->GetVariable (
                  VariableName,
                  &mFormSetGuid,
                  NULL,
                  &BufferSize,
                  &PrivateData->Configuration
                  );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  if (Request == NULL) {
    //
    // Request is set to NULL, return all configurable elements together with ALTCFG
    //
    Status = ConstructConfigAltResp (
               NULL,
               NULL,
               Results,
               &mFormSetGuid,
               VariableName,
               PrivateData->DriverHandle[0],
               &PrivateData->Configuration,
               BufferSize,
               VfrMyIfrNVDataBlockName,
               2,
               STRING_TOKEN (STR_STANDARD_DEFAULT_PROMPT),
               VfrMyIfrNVDataDefault0000,
               STRING_TOKEN (STR_MANUFACTURE_DEFAULT_PROMPT),
               VfrMyIfrNVDataDefault0001
               );

    return Status;
  }

  //
  // Check if requesting Name/Value storage
  //
  if (EfiStrStr (Request, L"OFFSET") == NULL) {
    //
    // Check routing data in <ConfigHdr>.
    // Note: there is no name for Name/Value storage, only GUID will be checked
    //
    if (!IsConfigHdrMatch (Request, &mFormSetGuid, NULL)) {
      *Progress = Request;
      return EFI_NOT_FOUND;
    }

    //
    // Update Name/Value storage Names
    //
    Status = LoadNameValueNames (PrivateData);
    if (EFI_ERROR (Status)) {
      *Progress = Request;
      return Status;
    }

    //
    // Allocate memory for <ConfigResp>, e.g. Name0=0x11, Name1=0x1234, Name2="ABCD"
    // <Request>   ::=<ConfigHdr>&Name0&Name1&Name2
    // <ConfigResp>::=<ConfigHdr>&Name0=11&Name1=1234&Name2=0041004200430044
    //
    BufferSize = (EfiStrLen (Request) +
                  1 + sizeof (PrivateData->Configuration.NameValueVar0) * 2 +
                  1 + sizeof (PrivateData->Configuration.NameValueVar1) * 2 +
                  1 + sizeof (PrivateData->Configuration.NameValueVar2) * 2 + 1) * sizeof (CHAR16);
    *Results = EfiLibAllocateZeroPool (BufferSize);
    ASSERT (*Results != NULL);
    EfiStrCpy (*Results, Request);
    Value = *Results;

    //
    // Append value of NameValueVar0, type is UINT8
    //
    if ((Value = EfiStrStr (*Results, PrivateData->NameValueName[0])) != NULL) {
      Value += EfiStrLen (PrivateData->NameValueName[0]);
      ValueStrLen = ((sizeof (PrivateData->Configuration.NameValueVar0) * 2) + 1);
      EfiCopyMem (Value + ValueStrLen, Value, EfiStrSize (Value));

      *Value++ = L'=';
      BufferSize = 16;
      BackupChar = Value[ValueStrLen - 1];
      BufToHexString (Value, &BufferSize, (UINT8 *) &PrivateData->Configuration.NameValueVar0, sizeof (PrivateData->Configuration.NameValueVar0));
      Value[ValueStrLen - 1] = BackupChar;
    }

    //
    // Append value of NameValueVar1, type is UINT16
    //
    if ((Value = EfiStrStr (*Results, PrivateData->NameValueName[1])) != NULL) {
      Value += EfiStrLen (PrivateData->NameValueName[1]);
      ValueStrLen = ((sizeof (PrivateData->Configuration.NameValueVar1) * 2) + 1);
      EfiCopyMem (Value + ValueStrLen, Value, EfiStrSize (Value));

      *Value++ = L'=';
      BufferSize = 16;
      BackupChar = Value[ValueStrLen - 1];
      BufToHexString (Value, &BufferSize, (UINT8 *) &PrivateData->Configuration.NameValueVar1, sizeof (PrivateData->Configuration.NameValueVar1));
      Value[ValueStrLen - 1] = BackupChar;
    }

    //
    // Append value of NameValueVar2, type is CHAR16 *
    //
    if ((Value = EfiStrStr (*Results, PrivateData->NameValueName[2])) != NULL) {
      Value += EfiStrLen (PrivateData->NameValueName[2]);
      ValueStrLen = EfiStrLen (PrivateData->Configuration.NameValueVar2) * 4 + 1;
      EfiCopyMem (Value + ValueStrLen, Value, EfiStrSize (Value));

      *Value++ = L'=';
      //
      // Convert Unicode String to Config String, e.g. "ABCD" => "0041004200430044"
      //
      ValueStrLen = ValueStrLen * sizeof (CHAR16);
      Status = UnicodeToConfigString (Value, &ValueStrLen, PrivateData->Configuration.NameValueVar2);
    }

    Progress = (EFI_STRING *) Request + EfiStrLen (Request);
    return EFI_SUCCESS;
  }

  //
  // Check routing data in <ConfigHdr>.
  // Note: if only one Storage is used, then this checking could be skipped.
  //
  if (!IsConfigHdrMatch (Request, &mFormSetGuid, VariableName)) {
    *Progress = Request;
    return EFI_NOT_FOUND;
  }

  //
  // Convert buffer data to <ConfigResp> by helper function BlockToConfig()
  //
  Status = HiiConfigRouting->BlockToConfig (
                                HiiConfigRouting,
                                Request,
                                (UINT8 *) &PrivateData->Configuration,
                                BufferSize,
                                Results,
                                Progress
                                );
  return Status;
}

EFI_STATUS
EFIAPI
RouteConfig (
  IN  EFI_HII_CONFIG_ACCESS_PROTOCOL         *This,
  IN  CONST EFI_STRING                       Configuration,
  OUT EFI_STRING                             *Progress
  )
/*++

  Routine Description:
    This function processes the results of changes in configuration.

  Arguments:
    This          - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
    Configuration - A null-terminated Unicode string in <ConfigResp> format.
    Progress      - A pointer to a string filled in with the offset of the most
                    recent '&' before the first failing name/value pair (or the
                    beginning of the string if the failure is in the first
                    name/value pair) or the terminating NULL if all was successful.

  Returns:
    EFI_SUCCESS           - The Results is processed successfully.
    EFI_INVALID_PARAMETER - Configuration is NULL.
    EFI_NOT_FOUND         - Routing data doesn't match any storage in this driver.

--*/
{
  EFI_STATUS                       Status;
  UINTN                            BufferSize;
  DRIVER_SAMPLE_PRIVATE_DATA       *PrivateData;
  EFI_HII_CONFIG_ROUTING_PROTOCOL  *HiiConfigRouting;
  CHAR16                           *Value;
  CHAR16                           *StrPtr;
  CHAR16                           BackupChar;
  UINTN                            Length;

  if (Configuration == NULL) {
    return EFI_INVALID_PARAMETER;
  }

  PrivateData = DRIVER_SAMPLE_PRIVATE_FROM_THIS (This);
  HiiConfigRouting = PrivateData->HiiConfigRouting;

  //
  // Get Buffer Storage data from EFI variable
  //
  BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
  Status = gRT->GetVariable (
                  VariableName,
                  &mFormSetGuid,
                  NULL,
                  &BufferSize,
                  &PrivateData->Configuration
                  );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Check if configuring Name/Value storage
  //
  if (EfiStrStr (Configuration, L"OFFSET") == NULL) {
    //
    // Check routing data in <ConfigHdr>.
    // Note: there is no name for Name/Value storage, only GUID will be checked
    //
    if (!IsConfigHdrMatch (Configuration, &mFormSetGuid, NULL)) {
      *Progress = Configuration;
      return EFI_NOT_FOUND;
    }

    //
    // Update Name/Value storage Names
    //
    Status = LoadNameValueNames (PrivateData);
    if (EFI_ERROR (Status)) {
      *Progress = Configuration;
      return Status;
    }

    //
    // Convert value for NameValueVar0
    //
    if ((Value = EfiStrStr (Configuration, PrivateData->NameValueName[0])) != NULL) {
      //
      // Skip "Name="
      //
      Value += EfiStrLen (PrivateData->NameValueName[0]);
      Value++;

      StrPtr = EfiStrStr (Value, L"&");
      if (StrPtr == NULL) {
        StrPtr = Value + EfiStrLen (Value);
      }
      BackupChar = *StrPtr;
      *StrPtr = L'\0';
      BufferSize = sizeof (PrivateData->Configuration.NameValueVar0);
      Status = HexStringToBuf ((UINT8 *) &PrivateData->Configuration.NameValueVar0, &BufferSize, Value, NULL);
      *StrPtr = BackupChar;
    }

    //
    // Convert value for NameValueVar1
    //
    if ((Value = EfiStrStr (Configuration, PrivateData->NameValueName[1])) != NULL) {
      //
      // Skip "Name="
      //
      Value += EfiStrLen (PrivateData->NameValueName[1]);
      Value++;

      StrPtr = EfiStrStr (Value, L"&");
      if (StrPtr == NULL) {
        StrPtr = Value + EfiStrLen (Value);
      }
      BackupChar = *StrPtr;
      *StrPtr = L'\0';
      BufferSize = sizeof (PrivateData->Configuration.NameValueVar1);
      Status = HexStringToBuf ((UINT8 *) &PrivateData->Configuration.NameValueVar1, &BufferSize, Value, NULL);
      *StrPtr = BackupChar;
    }

    //
    // Convert value for NameValueVar2
    //
    if ((Value = EfiStrStr (Configuration, PrivateData->NameValueName[2])) != NULL) {
      //
      // Skip "Name="
      //
      Value += EfiStrLen (PrivateData->NameValueName[2]);
      Value++;

      StrPtr = EfiStrStr (Value, L"&");
      if (StrPtr == NULL) {
        StrPtr = Value + EfiStrLen (Value);
      }
      BackupChar = *StrPtr;
      *StrPtr = L'\0';
      //
      // Convert Config String to Unicode String, e.g "0041004200430044" => "ABCD"
      //
      Length = sizeof (PrivateData->Configuration.NameValueVar2);
      Status = ConfigStringToUnicode (PrivateData->Configuration.NameValueVar2, &Length, Value);
      *StrPtr = BackupChar;
    }

    //
    // Store Buffer Storage back to EFI variable
    //
    Status = gRT->SetVariable(
                    VariableName,
                    &mFormSetGuid,
                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                    sizeof (DRIVER_SAMPLE_CONFIGURATION),
                    &PrivateData->Configuration
                    );

    return Status;
  }

  //
  // Check routing data in <ConfigHdr>.
  // Note: if only one Storage is used, then this checking could be skipped.
  //
  if (!IsConfigHdrMatch (Configuration, &mFormSetGuid, VariableName)) {
    *Progress = Configuration;
    return EFI_NOT_FOUND;
  }

  //
  // Convert <ConfigResp> to buffer data by helper function ConfigToBlock()
  //
  BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
  Status = HiiConfigRouting->ConfigToBlock (
                               HiiConfigRouting,
                               Configuration,
                               (UINT8 *) &PrivateData->Configuration,
                               &BufferSize,
                               Progress
                               );
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Store Buffer Storage back to EFI variable
  //
  Status = gRT->SetVariable(
                  VariableName,
                  &mFormSetGuid,
                  EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                  sizeof (DRIVER_SAMPLE_CONFIGURATION),
                  &PrivateData->Configuration
                  );

  return Status;
}

EFI_STATUS
EFIAPI
DriverCallback (
  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
  IN  EFI_BROWSER_ACTION                     Action,
  IN  EFI_QUESTION_ID                        QuestionId,
  IN  UINT8                                  Type,
  IN  EFI_IFR_TYPE_VALUE                     *Value,
  OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest
  )
/*++

  Routine Description:
    This function processes the results of changes in configuration.

  Arguments:
    This          - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
    Action        - Specifies the type of action taken by the browser.
    QuestionId    - A unique value which is sent to the original exporting driver
                    so that it can identify the type of data to expect.
    Type          - The type of value for the question.
    Value         - A pointer to the data being sent to the original exporting driver.
    ActionRequest - On return, points to the action requested by the callback function.

  Returns:
    EFI_SUCCESS          - The callback successfully handled the action.
    EFI_OUT_OF_RESOURCES - Not enough storage is available to hold the variable and its data.
    EFI_DEVICE_ERROR     - The variable could not be saved.
    EFI_UNSUPPORTED      - The specified Action is not supported by the callback.

--*/
{
  DRIVER_SAMPLE_PRIVATE_DATA      *PrivateData;
  EFI_STATUS                      Status;
  EFI_HII_UPDATE_DATA             UpdateData;
  IFR_OPTION                      *IfrOptionList;
  UINT8                           MyVar;
  UINTN                           BufferSize;
  DRIVER_SAMPLE_CONFIGURATION     *Configuration;

  if ((Value == NULL) || (ActionRequest == NULL)) {
    return EFI_INVALID_PARAMETER;
  }

  Status = EFI_SUCCESS;
  PrivateData = DRIVER_SAMPLE_PRIVATE_FROM_THIS (This);

  switch (QuestionId) {
  case 0x1234:
    //
    // Initialize the container for dynamic opcodes
    //
    IfrLibInitUpdateData (&UpdateData, 0x1000);

    IfrOptionList = EfiLibAllocatePool (2 * sizeof (IFR_OPTION));
    ASSERT (IfrOptionList != NULL);

    IfrOptionList[0].Flags        = 0;
    IfrOptionList[0].StringToken  = STRING_TOKEN (STR_BOOT_OPTION1);
    IfrOptionList[0].Value.u8     = 1;
    IfrOptionList[1].Flags        = EFI_IFR_OPTION_DEFAULT;
    IfrOptionList[1].StringToken  = STRING_TOKEN (STR_BOOT_OPTION2);
    IfrOptionList[1].Value.u8     = 2;

    CreateActionOpCode (
      0x1237,                           // Question ID
      STRING_TOKEN(STR_EXIT_TEXT),      // Prompt text
      STRING_TOKEN(STR_EXIT_TEXT),      // Help text
      EFI_IFR_FLAG_CALLBACK,            // Question flag
      0,                                // Action String ID
      &UpdateData                       // Container for dynamic created opcodes
      );

    //
    // Prepare initial value for the dynamic created oneof Question
    //
    PrivateData->Configuration.DynamicOneof = 2;
    Status = gRT->SetVariable(
                    VariableName,
                    &mFormSetGuid,
                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                    sizeof (DRIVER_SAMPLE_CONFIGURATION),
                    &PrivateData->Configuration
                    );

    //
    // Set initial vlaue of dynamic created oneof Question in Form Browser
    //
    BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
    Configuration = EfiLibAllocateZeroPool (sizeof (DRIVER_SAMPLE_CONFIGURATION));
    ASSERT (Configuration != NULL);
    Status = GetBrowserData (&mFormSetGuid, VariableName, &BufferSize, (UINT8 *) Configuration);
    if (!EFI_ERROR (Status)) {
      Configuration->DynamicOneof = 2;

      //
      // Update uncommitted data of Browser
      //
      SetBrowserData (
        &mFormSetGuid,
        VariableName,
        sizeof (DRIVER_SAMPLE_CONFIGURATION),
        (UINT8 *) Configuration,
        NULL
        );
    }
    gBS->FreePool (Configuration);

    CreateOneOfOpCode (
      0x8001,                           // Question ID (or call it "key")
      CONFIGURATION_VARSTORE_ID,        // VarStore ID
      DYNAMIC_ONE_OF_VAR_OFFSET,        // Offset in Buffer Storage
      STRING_TOKEN (STR_ONE_OF_PROMPT), // Question prompt text
      STRING_TOKEN (STR_ONE_OF_HELP),   // Question help text
      EFI_IFR_FLAG_CALLBACK,            // Question flag
      EFI_IFR_NUMERIC_SIZE_1,           // Data type of Question Value
      IfrOptionList,                    // Option list
      2,                                // Number of options in Option list
      &UpdateData                       // Container for dynamic created opcodes
      );

    CreateOrderedListOpCode (
      0x8002,                           // Question ID
      CONFIGURATION_VARSTORE_ID,        // VarStore ID
      DYNAMIC_ORDERED_LIST_VAR_OFFSET,  // Offset in Buffer Storage
      STRING_TOKEN (STR_BOOT_OPTIONS),  // Question prompt text
      STRING_TOKEN (STR_BOOT_OPTIONS),  // Question help text
      EFI_IFR_FLAG_RESET_REQUIRED,      // Question flag
      0,                                // Ordered list flag, e.g. EFI_IFR_UNIQUE_SET
      EFI_IFR_NUMERIC_SIZE_1,           // Data type of Question value
      5,                                // Maximum container
      IfrOptionList,                    // Option list
      2,                                // Number of options in Option list
      &UpdateData                       // Container for dynamic created opcodes
      );

    CreateGotoOpCode (
      1,                                // Target Form ID
      STRING_TOKEN (STR_GOTO_FORM1),    // Prompt text
      STRING_TOKEN (STR_GOTO_HELP),     // Help text
      0,                                // Question flag
      0x8003,                           // Question ID
      &UpdateData                       // Container for dynamic created opcodes
      );

    Status = IfrLibUpdateForm (
               PrivateData->HiiHandle[0],  // HII handle
               &mFormSetGuid,              // Formset GUID
               0x1234,                     // Form ID
               0x1234,                     // Label for where to insert opcodes
               TRUE,                       // Append or replace
               &UpdateData                 // Dynamic created opcodes
               );
    gBS->FreePool (IfrOptionList);
    IfrLibFreeUpdateData (&UpdateData);
    break;

  case 0x5678:
    //
    // We will reach here once the Question is refreshed
    //
    IfrLibInitUpdateData (&UpdateData, 0x1000);

    IfrOptionList = EfiLibAllocatePool (2 * sizeof (IFR_OPTION));
    ASSERT (IfrOptionList != NULL);

    CreateActionOpCode (
      0x1237,                           // Question ID
      STRING_TOKEN(STR_EXIT_TEXT),      // Prompt text
      STRING_TOKEN(STR_EXIT_TEXT),      // Help text
      EFI_IFR_FLAG_CALLBACK,            // Question flag
      0,                                // Action String ID
      &UpdateData                       // Container for dynamic created opcodes
      );

    Status = IfrLibUpdateForm (
               PrivateData->HiiHandle[0],  // HII handle
               &mFormSetGuid,              // Formset GUID
               3,                          // Form ID
               0x2234,                     // Label for where to insert opcodes
               TRUE,                       // Append or replace
               &UpdateData                 // Dynamic created opcodes
               );
    IfrLibFreeUpdateData (&UpdateData);

    //
    // Refresh the Question value
    //
    PrivateData->Configuration.DynamicRefresh++;
    Status = gRT->SetVariable(
                    VariableName,
                    &mFormSetGuid,
                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                    sizeof (DRIVER_SAMPLE_CONFIGURATION),
                    &PrivateData->Configuration
                    );

    //
    // Change an EFI Variable storage (MyEfiVar) asynchronous, this will cause
    // the first statement in Form 3 be suppressed
    //
    MyVar = 111;
    Status = gRT->SetVariable(
                    L"MyVar",
                    &mFormSetGuid,
                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
                    1,
                    &MyVar
                    );
    break;

  case 0x1237:
    //
    // User press "Exit now", request Browser to exit
    //
    *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
    break;

  case 0x2000:
    //
    // When try to set a new password, user will be chanlleged with old password.
    // The Callback is responsible for validating old password input by user,
    // If Callback return EFI_SUCCESS, it indicates validation pass.
    //
    switch (PrivateData->PasswordState) {
    case BROWSER_STATE_VALIDATE_PASSWORD:
      Status = ValidatePassword (PrivateData, Value->string);
      if (Status == EFI_SUCCESS) {
        PrivateData->PasswordState = BROWSER_STATE_SET_PASSWORD;
      }
      break;

    case BROWSER_STATE_SET_PASSWORD:
      Status = SetPassword (PrivateData, Value->string);
      PrivateData->PasswordState = BROWSER_STATE_VALIDATE_PASSWORD;
      break;

    default:
      break;
    }

    break;

  default:
    break;
  }

  return Status;
}

EFI_STATUS
EFIAPI
DriverSampleInit (
  IN EFI_HANDLE                   ImageHandle,
  IN EFI_SYSTEM_TABLE             *SystemTable
  )
{
  EFI_STATUS                      Status;
  EFI_STATUS                      SavedStatus;
  EFI_HII_PACKAGE_LIST_HEADER     *PackageList;
  EFI_HII_HANDLE                  HiiHandle[2];
  EFI_HANDLE                      DriverHandle[2];
  DRIVER_SAMPLE_PRIVATE_DATA      *PrivateData;
  EFI_SCREEN_DESCRIPTOR           Screen;
  EFI_HII_DATABASE_PROTOCOL       *HiiDatabase;
  EFI_HII_STRING_PROTOCOL         *HiiString;
  EFI_FORM_BROWSER2_PROTOCOL      *FormBrowser2;
  EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
  CHAR16                          *NewString;
  UINTN                           BufferSize;
  DRIVER_SAMPLE_CONFIGURATION     *Configuration;
  BOOLEAN                         ExtractIfrDefault;

  //
  // Initialize the library and our protocol.
  //
  EfiInitializeDriverLib (ImageHandle, SystemTable);

  //
  // Initialize screen dimensions for SendForm().
  // Remove 3 characters from top and bottom
  //
  EfiZeroMem (&Screen, sizeof (EFI_SCREEN_DESCRIPTOR));
  gST->ConOut->QueryMode (gST->ConOut, gST->ConOut->Mode->Mode, &Screen.RightColumn, &Screen.BottomRow);

  Screen.TopRow     = 3;
  Screen.BottomRow  = Screen.BottomRow - 3;

  //
  // Initialize driver private data
  //
  PrivateData = EfiLibAllocatePool (sizeof (DRIVER_SAMPLE_PRIVATE_DATA));
  if (PrivateData == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }

  PrivateData->Signature = DRIVER_SAMPLE_PRIVATE_SIGNATURE;

  PrivateData->ConfigAccess.ExtractConfig = ExtractConfig;
  PrivateData->ConfigAccess.RouteConfig = RouteConfig;
  PrivateData->ConfigAccess.Callback = DriverCallback;
  PrivateData->PasswordState = BROWSER_STATE_VALIDATE_PASSWORD;

  //
  // Locate Hii Database protocol
  //
  Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, &HiiDatabase);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  PrivateData->HiiDatabase = HiiDatabase;

  //
  // Locate HiiString protocol
  //
  Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, &HiiString);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  PrivateData->HiiString = HiiString;

  //
  // Locate Formbrowser2 protocol
  //
  Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, &FormBrowser2);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  PrivateData->FormBrowser2 = FormBrowser2;

  //
  // Locate ConfigRouting protocol
  //
  Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, &HiiConfigRouting);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  PrivateData->HiiConfigRouting = HiiConfigRouting;

  //
  // Install Config Access protocol
  //
  Status = CreateHiiDriverHandle (&DriverHandle[0]);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  PrivateData->DriverHandle[0] = DriverHandle[0];

  Status = gBS->InstallProtocolInterface (
                  &DriverHandle[0],
                  &gEfiHiiConfigAccessProtocolGuid,
                  EFI_NATIVE_INTERFACE,
                  &PrivateData->ConfigAccess
                  );
  ASSERT_EFI_ERROR (Status);

  //
  // Publish our HII data
  //
  PackageList = PreparePackageList (
                  2,
                  &mFormSetGuid,
                  DriverSampleStrings,
                  VfrBin
                  );
  if (PackageList == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }

  Status = HiiDatabase->NewPackageList (
                          HiiDatabase,
                          PackageList,
                          DriverHandle[0],
                          &HiiHandle[0]
                          );
  gBS->FreePool (PackageList);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  PrivateData->HiiHandle[0] = HiiHandle[0];

  //
  // Publish another Fromset
  //
  Status = CreateHiiDriverHandle (&DriverHandle[1]);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  PrivateData->DriverHandle[1] = DriverHandle[1];

  PackageList = PreparePackageList (
                  2,
                  &mInventoryGuid,
                  DriverSampleStrings,
                  InventoryBin
                  );
  if (PackageList == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }

  Status = HiiDatabase->NewPackageList (
                          HiiDatabase,
                          PackageList,
                          DriverHandle[1],
                          &HiiHandle[1]
                          );
  gBS->FreePool (PackageList);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  PrivateData->HiiHandle[1] = HiiHandle[1];

  //
  // Very simple example of how one would update a string that is already
  // in the HII database
  //
  NewString = L"700 Mhz";

  Status = IfrLibSetString (HiiHandle[0], STRING_TOKEN (STR_CPU_STRING2), NewString);
  if (EFI_ERROR (Status)) {
    return Status;
  }

  //
  // Initialize Name/Value name String ID
  //
  PrivateData->NameStringId[0] = STR_NAME_VALUE_VAR_NAME0;
  PrivateData->NameStringId[1] = STR_NAME_VALUE_VAR_NAME1;
  PrivateData->NameStringId[2] = STR_NAME_VALUE_VAR_NAME2;

  //
  // Initialize configuration data
  //
  Configuration = &PrivateData->Configuration;
  EfiZeroMem (Configuration, sizeof (DRIVER_SAMPLE_CONFIGURATION));

  //
  // Try to read NV config EFI variable first
  //
  ExtractIfrDefault = TRUE;
  BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
  Status = gRT->GetVariable (VariableName, &mFormSetGuid, NULL, &BufferSize, Configuration);
  if (!EFI_ERROR (Status) && (BufferSize == sizeof (DRIVER_SAMPLE_CONFIGURATION))) {
    ExtractIfrDefault = FALSE;
  }

  if (ExtractIfrDefault) {
    //
    // EFI variable for NV config doesn't exit, we should build this variable
    // based on default values stored in IFR
    //
    BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
    Status = ExtractDefault (Configuration, &BufferSize, 1, VfrMyIfrNVDataDefault0000);

    if (!EFI_ERROR (Status)) {
      gRT->SetVariable(
             VariableName,
             &mFormSetGuid,
             EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
             sizeof (DRIVER_SAMPLE_CONFIGURATION),
             Configuration
             );
    }
  }

  //
  // Example of how to display only the item we sent to HII
  //
  if (DISPLAY_ONLY_MY_ITEM == 0x0001) {
    //
    // Have the browser pull out our copy of the data, and only display our data
    //
    //    Status = FormConfig->SendForm (FormConfig, TRUE, HiiHandle, NULL, NULL, NULL, &Screen, NULL);
    //
    Status = FormBrowser2->SendForm (
                             FormBrowser2,
                             HiiHandle,
                             1,
                             NULL,
                             0,
                             NULL,
                             NULL
                             );
    SavedStatus = Status;

    Status = HiiDatabase->RemovePackageList (HiiDatabase, HiiHandle[0]);
    if (EFI_ERROR (Status)) {
      return Status;
    }

    Status = HiiDatabase->RemovePackageList (HiiDatabase, HiiHandle[1]);
    if (EFI_ERROR (Status)) {
      return Status;
    }

    return SavedStatus;
  } else {
    //
    // Have the browser pull out all the data in the HII Database and display it.
    //
    //    Status = FormConfig->SendForm (FormConfig, TRUE, 0, NULL, NULL, NULL, NULL, NULL);
    //
  }

  return EFI_SUCCESS;
}


text:
Aylmer Bourke Lambert, Esq., F.R.S., F.A.S., one of the Vice Presidents of the Linnean Society [picture] / engraved by W. Evans from an original drawing by H. Edridge
Evans, W. (William), active 1810-1822
London : Published by T. Cadell & W. Davies, Aug. 11, 1810
1 print : stipple engraving ; plate mark 38.1 x 32.7 cm.
Evans, W & Edridge, H. (1810). Aylmer Bourke Lambert, Esq., F.R.S., F.A.S., one of the Vice Presidents of the Linnean Society Retrieved January 30, 2023, from http://nla.gov.au/nla.obj-133275170
Evans, W and Edridge, H. Aylmer Bourke Lambert, Esq., F.R.S., F.A.S., one of the Vice Presidents of the Linnean Society London: Published by T. Cadell & W. Davies, 1810. Web. 30 January 2023 <http://nla.gov.au/nla.obj-133275170>
Evans, W & Edridge, H. 1810, Aylmer Bourke Lambert, Esq., F.R.S., F.A.S., one of the Vice Presidents of the Linnean Society Published by T. Cadell & W. Davies, London viewed 30 January 2023 http://nla.gov.au/nla.obj-133275170
| author1=Evans, W.
| author2=Edridge, H.
| title=Aylmer Bourke Lambert, Esq., F.R.S., F.A.S., one of the Vice Presidents of the Linnean Society
| section=1 print : stipple engraving ; plate mark 38.1 x 32.7 cm.
| location=London
| publisher=Published by T. Cadell & W. Davies

redpajama_set_name: RedPajamaCommonCrawl


Connect with family, community and nature during our Family Camp weekend!
Activities for the whole family and age-appropriate programs for all ages!
Financial assistance for Family Camp is available upon request; requests can be submitted here.


text:
The Irish Legion () was a light infantry regiment in service of the French Imperial Army established in 1803 for an anticipated invasion of Ireland. It was later expanded to a four battalions and a depot, the legion won distinction in the Walcheren Expedition, the Peninsular War, and the German Campaign of 1813.  Following the disbandment of the foreign regiments in 1815, the regiment's personnel were distributed.

Establishment
The first officers included members of the Society of United Irishmen who had fled to France in 1797. It also included Irishmen who had been taken during the 1798 rebellion who were freed during the short peace effected by the Treaty of Amiens on condition of exile, and who had sailed for France in June 1802. The treaty broke down in May 1803 with the start of the War of the Third Coalition. As a part of Napoleon's planned invasion of the United Kingdom in 1803–05, the Irish Legion was to provide the indigenous core for a much larger invasion force of 20,000 earmarked to take Ireland, known as the Corps d'Irlande.

The Legion was established on 31 August 1803 in Morlaix, France. Bernard MacSheehy was assigned to form the regiment. He was an Adjutant-General in Napoleon's army.

The purpose of the Legion was to align the Irish hearts to the French cause in the imminent invasion of Ireland. General Pierre Augereau had been ordained to lead the invasion, and wanted Irishmen to serve in his army. However, the Battle of Cape Finisterre and the Battle of Trafalgar in 1805 made a safe sea crossing uncertain at best, and Napoleon was forced to abandon his plans for Ireland. He shifted his focus towards Austria and Eastern Europe and launched the Austerlitz campaign in late 1805. The legion remained on the French coast on garrison duty and coastal defence.

Formation and colours
The Legion was eventually expanded from a battalion to a regiment and there was greater demand for more soldiers. These made a varied group; some were former United Irishmen who were taken prisoner in 1798-99 and then freed during the peace that followed the Treaty of Amiens (1802–03), some had been impressed into the Royal Navy and deserted, and some were German or Polish. While the Legion was stationed at the Fortress of Mainz in 1806, they were joined by 1,500 Poles and many Irishmen who were sent in 1799 to serve the King of Prussia, Its headquarters was at 's-Hertogenbosch, known to the French as Bois-le-Duc, in what was then the Kingdom of Holland.

The Irish Legion had its own flag, and in December 1805 received an eagle. The Legion was the only group of foreign soldiers in the French military to whom Napoleon ever gave an eagle. Wearing a green uniform, its maximum size was about 2,000 men.

The regiment was greatly assisted from 1807 by Napoleon's war minister Marshal of France Henri Clarke, who was born in France to Irish parents and whose family had close links to the ancien regime Irish brigade that had served the kings of France. He and his father had served in Dillon's Regiment, and his mother's father and several uncles served in Clare's Regiment. In August 1811 the Legion was renamed the 3e Regiment Etranger (Irlandais) (3rd Foreign Regiment (Irish)), but throughout the unit's history it was always referred to as the Irish Regiment.

Actions

In 1808 the Second Battalion fought in the Peninsular War, helping to subdue Madrid during the Dos de Mayo Uprising.

In the middle of January 1810 the 3rd Battalion was posted to Spain. In June 1810 an Army of Portugal was formed under Masséna which was composed of three Army Corps. The two battalions of the Irish Legion became part of General Junot's 8th Corps. Before joining with the Massena's main army, Junot was detailed to secure the flank of the Army of Portugal's intended advance by capturing the city of Astorga in the Province of León. They led the assault that took the city. During the battle, Captain John Allen's company's drummer boy continued to beat the charge after having lost both legs, for which he was given the French Legion of Honor. The Irish Battalions remained on active service with the Army of Portugal through the sieges of Ciudad Rodrigo and Almeida, the Battle of Bussaco and the full course of the advance to the Lines of Torres Vedras.

In September 1810, at the Battle of Bussaco, elite companies of the Irish Legion engaged an Irish regiment in the British army, the 88th Foot (Connaught Rangers). William Grattan's Adventure of the Connaught Rangers details an engagement between the two units among the rocks above Bussaco. The Connaughts led an epic bayonet charge against the French troops there and after the action, Grattan explains, he came across the French 4th regiment and the Irish Brigade (meaning, of course, the Irish Regiment) on the rocks there, mentioning that several of the latter were wounded but there were no Irishmen among them (denoting that the wounded men from the Irish Regiment were all foreigners).

Napoleon had decreed on 28 October 1810 that the Irish Regiment should be reduced to two battalions, whereby the 2nd and 3rd Battalions would become the 2nd Battalion. The reformed 2nd Battalion saw hard service as part of the rearguard on the retreat from Lisbon. By the time it arrived back in Spain, the unit had nineteen officers and 254 men present with the colours, and another 128 men absent from sickness or other reasons.

Solignac's Division took the field once more in the spring of 1811 for the relief of Almeida; at this time the battalion strength was 390 officers and men. Between 3 and 5 May, heavy fighting took place at Fuentes de Oñoro and on the slopes in the vicinity. On the first day, Solignac's Division was held in reserve behind the centre-right of Massena's line and the Irish remained idle all day. On the 5th they were the general reserve to the flanking attack made on the British right wing and again were not engaged.

In early December 1811, the orders arrived in Spain for the return to France of the officers and non-commissioned officers of the Irish Battalion. The non-Irish privates were to be incorporated into the Prussian Regiment serving with the Army of Portugal. It was not until 11 April 1812 that they arrived at the regimental depot at Bois-le-Duc (s'Hertogenbosch) in The Netherlands.

The First Battalion saw its first action at the Battle of Flushing in the Walcheren Campaign of 1809, suffering many casualties from malaria.

Early in 1813 the Irish Regiment was ordered to merge the three existing battalions into two full-strength war battalions. Command of the 1st Battalion went to Chef de Bataillon John Tennent and that of the 2nd Battalion to Chef de Bataillon Hugh Ware. On 1 February they broke camp and made a long winter march to Magdeberg. The Irish Regiment made forced marches to arrive on the battlefield of Bautzen during the morning of 21 May, the second day of the battle. At the head of Puthod's Division they attacked Barclay's Corps on the extreme allied right.

On 26 May they fought with distinction at the Battle of Hanau under the direct command of the emperor. The Irish were rewarded by being given the honour of posting guard at the town of Lignitz (Legnica) for Napoleon until the Imperial Guard arrived and relieved them.

On 16 August, at the end of the brief armistice, Puthod's Division, including Vacherau's Brigade (The Irish Regiment, 134th & 143rd Regiments), were assembled at Goldberg in Silesia. On the eighteenth Blucher's cavalry made contact with Puthod. The regiment formed squares to repel a cavalry attack: the squares held fast, and after a number of attempts to break them, the enemy backed off and brought forward artillery. They were then easy targets for cannon fire, losing 400 men before retiring in good order.

Following Macdonald's retreat after the Battle of the Katzbach with Blucher, General Pothod's Division became isolated from the rest of the army. The River Bober (Bóbr) had risen out of its banks from the heavy rains and the bridges were under water. The division had been reduced to six thousand men and twelve pieces of artillery. On the morning of 29 August they reached the town of Lowenberg/Lwówek Śląski. It took up the best position it could find, on the narrow ridge above Plakowice, with its back to the river. All the bridges had been washed away and there was no possibility of constructing a bridge with the river flooding its banks on both sides. A combined Russian and Prussian Army of overwhelming superiority faced the Division but could only attack at the one narrow south-eastern end of the ridge. The battle began at 8:00 am and lasted until after 4:00pm. When the Division had expended the last of its ammunition, the enemy attacked and overran its position.
Most of the officers waded into the river and swam to the opposite shore. The riverbed itself was not terribly wide although the current was strong. They were able to wade about half the distance, swim a short way, and walk through the water to dry land. James Perry swam over and back again to come to the aid of General Puthod, whose ADC he was, and both were taken prisoner. The total French casualties of killed, wounded, drowned and captured was more the 3,000.

The Irish Regiment no longer existed as a fighting unit. Twenty-three officers out of 47 and 94 non-commissioned officers and soldiers returned from the campaign of 1813. Out of approximately 2,000 men who had marched to join the Grand Army eight months earlier, only 117 were left. The survivors managed to save their eagle and retired to Bois-le-Duc.

In the ensuing Napoleonic retreat the regiment took part in the Siege of Antwerp 1814 and retired to Lille, where it remained until Napoleon's abdication in April 1814.

In 1805-15 eleven of the regiment's officers were awarded the Legion d'honneur, including Chef de Bataillon Myles Byrne, the colonel, William Lawless, Chef de Bataillon John Tennent, and James Bartholomew Blackwell.

Disbandment
The regiment divided in loyalty during the "Hundred Days", and was officially disbanded by King Louis XVIII on 28 September 1815. Its flags were burned and its eagle, like many, disappeared.

Notes

References

Further reading
 Byrne, Miles (1863). Memoirs of Miles Byrne Vol. 2
 Charrié, Pierre. Drapeaux & Etendards de la Révolution et de l'Empire
 Gallaher, John G. (1993). Napoleon's Irish Legion.
 McGarry, Stephen (2013). Irish Brigades Abroad

Military units and formations established in 1803
Military units and formations disestablished in 1815
Irish regiments in French service
1803 establishments in France
1815 disestablishments in France
1803 establishments in Ireland
1815 disestablishments in Ireland
Volunteer units and formations of the French Revolutionary Wars
French military units and formations of the Napoleonic Wars

redpajama_set_name: RedPajamaWikipedia


text:
\section{Introduction}
\label{sec:intro}

Constant decrease of the duration of light pulses achieved in experiments sharpens the spectroscopic probe used to dissect different atomic and molecular ultrafast processes.
This applies not only to nuclear dynamics occurring on the timescale of tens to hundreds of femtoseconds but also to electron dynamics happening about three orders of magnitude faster.~\cite{Schultz_book_2014,Lepine_CPL_2013}
In particular, the unprecedented insight into the electron's ``chemistry'' has become possible due to development of free-electron lasers and high-harmonic generation sources of ultrashort pulses.~\cite{Young_JPB_2018}

These pulses have sufficient bandwidth to create a non-stationary superposition of several electronic states and to follow the dynamics of the initiated wavepacket which can be caused both by nuclear and electronic motion. Although experimental developments are only at the beginning of their way, bright prospects are seen and the topic is actively developed by theoreticians (for review see, e.g., Refs.~\citenum{Moskalenko_PR_2017,Kuleff_JPB_2014,Zhang_TCC_2015}). For instance, the process of charge migration, where the dynamics of an electronic wavepacket being a superposition of ionized states has been extensively studied theoretically. In this case, the driving force of the dynamics is electron correlation and relaxation. The nuclear motion is argued either to be of minor importance or to cause an ultrafast dephasing destroying coherent electron dynamics. For a discussion of the relevance of  nuclear motion for the early-time electron dynamics, see, e.g., Refs.~\citenum{Mendive-Tapia_JCP_2013, Li_PRL_2015, Vacher_PRA_2015, Despre_JPCL_2015,Arnold_PRA_2017}.

Recently, ultrafast electron dynamics driven by strong spin-orbit coupling (SOC) in the 2p core-excited states of an iron complex have been reported.~\cite{Wang_PRL_2017,Wang_MP_2017}  Remarkably, the dynamics occur on a timescale faster than the Auger decay lifetime of few femtoseconds.  These studies considered excitation by a single isolated X-ray pulse, thus, resembling a free electron laser experiments. However, the experimental realization with a High Harmonic Generation (HHG) setup would require additional effort to obtain such isolated pulses if compared to trains of pulses which are more common in this case.~\cite{Schultz_book_2014} Therefore, in the present work, we extend previous studies for the exemplary case of Fe$^{2+}$ in its first solvation shell along two lines: First, we consider the dynamics driven by trains of ultrashort pulses, which are easier to generate in HHG experiments. Second, we examine the decoherence caused by nuclear vibrations. To this end, a  system (electronic degrees of freedom)/bath (nuclear degrees of freedom) model is introduced, whose dynamics is treated using a Quantum Master Equation.   In~Sec.~\ref{sec:theory}, the general framework of the employed time-dependent formalism is presented, followed by the description of computational details in Sec.~\ref{sec:comp}.  The consequences of dissipation caused by the vibrational bath as well as dynamics caused by series of pulses are discussed in Sec.~\ref{sec:results}. Conclusions and outlook are given in Sec.~\ref{sec:concl}.
\section{Theory}
\label{sec:theory}

In the following, we make use of the Born-Oppenheimer approximation, thus assuming that the system is excited far from conical intersections.
The actual dynamics are studied at a single geometry of the molecule, assuming vertical excitation by the incoming light. The timescale of the processes discussed here (few femtoseconds) is much shorter than the periods of relevant nuclear vibrations (see discussion in Sec.~\ref{sec:results}), what builds the basis for the present model.

In order to account at least approximately for a possible influence of molecular vibrations but also for loss channels such as Auger decay, a system-bath approach will be used, i.e. the total Hamiltonian is written as
\begin{equation}\label{eq:TotHam}
\hat{H}(t)=\hat{H}_{\rm  S}(t)+\hat{H}_{\rm B}+\hat{H}_{\rm S-B} \,.
\end{equation}
Here, $\hat{H}_{\rm S}(t)$ describes the relevant system, i.e. that part of the electronic degrees of freedom (DOF) whose dynamics is triggered by the X-ray light.  The relevant system is coupled via $\hat{H}_{\rm S-B} $ to some bath with Hamiltonian $\hat{H}_{\rm B}$. The dynamics of the relevant system according to the reduced density operator, $\hat\rho$, follows from the Quantum Master Equation ($\hbar=1$)~\cite{May_book_2011}
 \begin{equation}\label{eq:LvN}
    \frac{\partial}{\partial{t}}\hat{\rho}=-i[\hat{H}_{\rm S}(t),\hat{\rho}]+\mathcal{R}\hat\rho\ +\mathcal{A}\hat\rho \,.
  \end{equation}
  %
  Equation \eqref{eq:LvN} assumes that the effect of the system-bath interaction can be treated in second order perturbation theory and invoking the Markov approximation. Here, $\mathcal{R}$ is the dissipation superoperator, which accounts for phase and energy  relaxation due to interaction with the vibrational bath and $\mathcal{A}$ accounts for the Auger decay.
The framework for the description of the electronic subsystem with the density matrix-based restricted active space configuration interaction ($\rho$-TD-RASCI) is introduced in Section~\ref{sec:tdci} and the construction of $\mathcal{R}$ and $\mathcal{A}$ is described in Section~\ref{sec:dissipation}.

\subsection{$\rho$-TD-RASCI}
\label{sec:tdci}

Within the $\rho$-TD-RASCI method, described elsewhere in detail,\cite{Wang_PRL_2017, Wang_MP_2017} see also Refs.~\citenum{Tremblay_JCP_2011,Kato_PTPS_2012,Jin_PRL_2012}, the reduced density operator is represented in the basis of electronic Configuration State Functions (CSFs), $\{ \Phi_j^{(S,M_S)}\}$, with the total spin $S$ and its projection $M_S$. Note that the relaxation of one-electron molecular orbitals (MO) is not taken into account and CSFs are constructed using a time-independent MO basis, optimized at the restricted active space self-consistent field~\cite{Malmqvist_JPC_1990} level prior to propagation. On this   level, $\rho$-TD-RASCI can describe electron correlation-driven processes (see regime III in Ref.~\citenum{Wang_MP_2017}) analogous to charge migration in ionized species.~\cite{}

The Hamiltonian in the CSF basis reads
\begin{eqnarray}
	\label{eq:Ham}
   \mathbf{H}_{\rm S}(t)&= &\mathbf{H}_{\rm CI}+\mathbf{V}_{\rm SOC}+\mathbf{U}_{\rm ext}(t) \nonumber \\
   &=&
   \left(
   \begin{array}{cc}
      \mathbf{H}_{h}  &  0 \\
      0  & \mathbf{H}_{l} \\
   \end{array}
   \right)
   +
   \left(
   \begin{array}{cc}
      \mathbf{V}_{hh}  &  \mathbf{V}_{hl} \\
      \mathbf{V}_{lh}  &  \mathbf{V}_{ll} \\
   \end{array}
   \right)
   +
  \left(
  \begin{array}{cc}
      \mathbf{U}_{h}(t) &  0 \\
      0  &  \mathbf{U}_{l}(t) \\
   \end{array}
   \right), \nonumber \\
   \,
\end{eqnarray}
where we separated blocks of low- ($l$) and high-spin ($h$) basis functions. In Eq.~\eqref{eq:Ham}, $\mathbf{H}_{\rm CI}$ is the configuration interaction (CI) Hamiltonian matrix containing the effect of electron correlation.  SOC is contained in $\mathbf{V}_{\rm SOC}$, whose matrix elements are calculated in the LS-coupling limit, making use of the atomic mean-field integral approximation.~\cite{Hess_CPL_1996} The interaction with the time-dependent electric field, $\mathbf{U}_{s=h,l}(t)=-\vec{\mathbf{d}}_{ss} \cdot \vec{E}(t)$,
is taken in  semiclassical dipole approximation with the transition dipole matrices $\vec{\mathbf{d}}_{hh}$ and $\vec{\mathbf{d}}_{ll}$ ($\vec{\mathbf{d}}_{hl}=\vec{\mathbf{d}}_{lh}=\vec{\mathbf{0}}$).
The electric field, $\vec{E}(t)$, corresponds to a train of ultrashort pulses with temporal positions $t_i$, polarizations $\vec{e}$, carrier frequencies $\Omega$ and Gaussian envelopes with width $\sigma$, modeling HHG output, (cf. Fig.~\ref{fig:multi_pulse_scheme}a)):
\begin{align}\label{eq:pulse}
\vec{E}(t) &= \vec{e}\tilde{E}(t)\cos(\Omega t) \\
\tilde{E}(t) &= E_0\sum_i\exp(-(t-t_i)^2/(2\sigma^2)). \nonumber
\end{align}
The delay between two subpulses, $t_i-t_{i-1}$, is determined by the half-period of the optical cycle of the HHG driving laser. The influence of carrier-envelope phase is considered to be irrelevant for the carrier frequency $\Omega$ in X-ray range, since multiple oscillations occur within a single pulse in a train.

\begin{figure}
\includegraphics[width=0.45\textwidth]{pulse_parameters_new.pdf}
\caption{a) Scheme explaining the parameters of the light pulse envelope (Eq.~\ref{eq:pulse}); see also Table~\ref{tab:pulse}. $T$ is the period of the driving laser optical cycle.
b) Calculated X-ray absorption spectrum. The energies corresponding to carrier frequencies $\hbar \Omega=$708.4 and 711.5\,eV are marked with arrows. The frequency combs corresponding to HHG with the respective wavelengths of the driving laser are also shown. The structure of the [Fe(H$_2$O)$_{6}$]$^{2+}$ complex is presented as an inset.
\label{fig:multi_pulse_scheme}
}
\end{figure}

The eigenstates of $\mathbf{H}_{\rm CI}$ will be called spin-free (SF) states, they are given by the set $\{\Psi^{{\rm SF},(S,M_S)}_{n}\}$. This set can be used to express the eigenstates of $\mathbf{H}_{\rm CI}+\mathbf{V}_{\rm SOC}$, which are called SOC states, as follows:
\begin{equation}\label{eq:SOC_states}
 \ket{\Psi^{\rm SOC}_{a}}=\sum_{n}C_{an}^{(S,M_S)} \ket{\Psi^{{\rm SF},(S,M_S)}_{n}} \, .
\end{equation}
The notation of the coefficients implies that there is a correspondence $n\leftrightarrow (S,M_S)$.
The SOC basis will be used for representation of the reduced density operator in Eq.~\eqref{eq:LvN}, which takes the form
 \begin{eqnarray}\label{eq:LvN_SOC}
    \frac{\partial}{\partial{t}}\rho_{ab}&=&-i\omega_{ab}\rho_{ab} +i {\vec E}(t) \sum_{c} ({\vec d}_{ac}\rho_{cb} - {\vec d}_{cb}\rho_{ac})\nonumber\\
    &-& \sum_{cd} (\mathcal{R}_{ab,cd}+\mathcal{A}_{ab,cd}) \rho_{cd} \, .
  \end{eqnarray}
  %
Thus, the time-propagation is performed in the SOC basis which ensures the rigorous structure of the respective equations of motion for the dissipative dynamics leading to proper equilibration.\cite{May_book_2011}
However, the analysis below will also involve the populations  of SF states for a certain multiplicity. They are obtained from
\begin{equation}
	\rho_{nn}^{(S)}=\sum_{ab} C_{an}^{(S,M_S)}[C_{bn}^{(S,M_S)}]^* \rho_{ab} \,.
\end{equation}

\iffalse
The structure of the SF state can be viewed as linear combination
\begin{equation}\label{wave function}
    |\Psi^{\rm SF}\rangle=C_0 \ket{\Psi_{0}}+\underbrace{\sum_{ia}C_{i}^{a}\ket{\Psi_{i}^{a}}}_{\rm 1h1p}+\underbrace{\sum_{i<j,a<b}C_{ij}^{ab}\ket{\Psi_{ij}^{ab}}}_{\rm 2h2p}+\ldots,
\end{equation}
where $\ket{\Psi_{0}}$ represents the reference wave function of the ground electronic state and the remaining terms are the single (1h1p), double (2h2p), etc excitations from the ground state configuration.
Indices $i,j,\ldots$ denote occupied MOs from which electron is excited to unoccupied $a,b,\ldots$ ones.
\fi

\subsection{Dissipation Operators}
\label{sec:dissipation}

First, we focus on $\mathcal{R}$ which describes the effect of electron-vibrational coupling.  Having in mind the case of
a Fe$^{2+}$ ion in its first solvation shell, it is assumed that the vibrations of [Fe(H$_2$O)$_6$]$^{2+}$ can be mapped onto a harmonic oscillator model. In other words, the vibrational bath is assumed to be a collection of harmonic oscillators in thermal equilibrium coupled to the electronic transitions in a Huang-Rhys like fashion.~\cite{May_book_2011} This constitutes the primary vibrational bath with the interaction operator

\begin{equation}
\hat{H}_{\rm el-vib}=\sum_{ab}\sum_{\xi}g_{ab,\xi}\omega_{\xi}Q_{\xi}\ket{\Psi^{\rm SOC}_{a}}\bra{\Psi^{\rm SOC}_{b}} \, ,
\end{equation}
where  $a$ and $b$ label the coupled electronic states and $Q_\xi$ is the coordinate of the normal mode $\xi$ having frequency $\omega_{\xi}$.
Here, $g_{ab,\xi}$ is the dimensionless shift of the $a$'s state harmonic potential energy surface with respect to the potential of state $b$, which can be expressed by the Huang-Rhys factor $S_{ab,\xi}=g_{ab,\xi}^{2}/2$.
The coupling strengths $g_{ab,\xi}$ in the SOC basis have been obtained by the transformation of factors $g^{\rm SF}_{0n,\xi}$, evaluated in the  basis of SF states with respect to the ground state $n=0$,  according to Eq.~\eqref{eq:SOC_states}. Note that one could further take the non-adiabatic couplings into account explicitly within an approach described in Ref.~\citenum{Hermann_JPCC_2015}.

This primary bath describing [Fe(H$_2$O)$_6$]$^{2+}$ is coupled to a secondary one (further solvation shells) leading to a multi-mode Brownian oscillator model.~\cite{Mukamel_book_1999}
In total, the effect of primary and secondary bath can be described by the following spectral density

\begin{equation}\label{eq:J}
J_{ab}(\omega)=\sum_{\xi}\omega_{\xi}^{2}g_{ab,\xi}^{2}\frac{\omega\omega_{\xi}\gamma}{(\omega^{2}-\omega_{\xi}^{2})^{2}+\omega^{2}\gamma^{2}}\, ,
\end{equation}
where the parameter $\gamma$ accounts for the influence of the secondary bath.

For simplicity we will restrict ourselves to the Bloch model which decouples population relaxation and coherence dephasing.
In this case, the only non-zero elements of the relaxation matrix (Redfield tensor)  ${\mathcal R}_{ab,cd}$ are given by
\begin{equation}\label{eq:population}
{\mathcal R}_{aa,cc}=\delta_{ac}\sum_{e} k_{a\rightarrow e}-k_{c\rightarrow a}
\end{equation}
for  population relaxation  and
\begin{equation}\label{eq:dephasing}
{\mathcal R}_{ab,ab}=\frac{1}{2}(\sum_{e}k_{a\rightarrow e}+\sum_{e}k_{b\rightarrow e})
\end{equation}
for coherence dephasing.
The relaxation rates $k_{a\rightarrow b}$ for the transition from a state $\ket{\Psi^{\rm SOC}_{a}}$  to a state $\ket{\Psi^{\rm SOC}_{b}}$, can be expressed as
\begin{equation}\label{eq:k_ab}
k_{a\rightarrow b}=2[1+n(\omega)][J_{ab}(\omega)-J_{ab}(-\omega)] \, ,
\end{equation}
where $n(\omega)=(\exp({\omega/k_{\rm B}T)-1})^{-1}$ is Bose-Einstein distribution function.

The Auger autoionization, which for L-edge states of early transition metals is known to dominate the population decay,~\cite{Stoehr_book_1992} is incorporated  phenomenologically by the decay rate $\Gamma_a$  yielding the simple Auger decay matrix
\begin{equation}\label{eq:Auger}
\mathcal{A}_{ab,cd} =-\delta_{ab}\delta_{cd}\delta_{ac} \Gamma_a \, .
\end{equation}
Notice that this term is not norm-conserving.
\begin{table}
\caption{Pulse train characteristics: wavelength of the driving laser $\lambda$, delay between two pulses in a sequence $t_i-t_{i-1}$ (see Eq.~\ref{eq:pulse}), duration of a single pulse $\sigma = T/14$ and $\sigma = T/28$, where $T$ is the period of the optical cycle of the driving laser
\label{tab:pulse}}
\begin{tabular}{p{1.5cm} p{2cm} p{1.5cm} p{1.5cm}}
$\lambda$, nm & $t_i-t_{i-1}$, fs & $T/14$, fs & $T/28$, fs \\
\hline
\hline
400 & 0.67 & 0.095 & 0.048 \\
800 & 1.33 & 0.191 & 0.095 \\
1400 & 2.34 & 0.334 & 0.167 \\
2000 & 3.34 & 0.476 & 0.238 \\
\hline
\end{tabular}
\end{table}

\section{Computational details}
\label{sec:comp}
The approach is applied to the spin-dynamics in the core-excited [Fe(H$_2$O)$_{6}$]$^{2+}$ complex
representing a model of the solvated Fe$^{2+}$ ion, see Fig.~\ref{fig:multi_pulse_scheme}b).
Its X-ray absorption and resonant inelastic X-ray scattering spectra were discussed in Refs.~\citenum{Bokarev_PRL_2013,Atak_JPCB_2013,Golnak_SR_2016}.
The ground electronic state of [Fe(H$_2$O)$_{6}$]$^{2+}$ corresponds to the quintet ($S=2$) high-spin d$^6$ electronic configuration, which should be triply degenerate if octahedral symmetry is assumed.
This degeneracy is lifted due to the weak Jahn-Teller effect leading to the three close-lying electronic states.

CSFs were constructed within a RASSCF (restricted active space self-consistent field) scheme using an active space containing 12 electrons distributed over the three 2p (1 hole is allowed) and five 3d (full CI) orbitals.
This setup is sufficient to describe the core excited electronic states corresponding to the dipole allowed 2p$\rightarrow$3d transitions.~\cite{Bokarev_PRL_2013,Atak_JPCB_2013,Golnak_SR_2016}
In total, 35 quintet ($S=2$) and 195 triplet ($S=1$) electronic states, directly interacting via SOC according to the $\Delta S=0,\pm1$ selection rule, were considered.
Accounting for the different $M_S$ microstates, the total number of  SF and SOC  states was 760, with 160 being valence and 600 core ones.
Scalar relativistic effects we considered at the second-order Douglas-Kroll-Hess transformation level.~\cite{Douglas_AP_1974}
Time-independent matrix elements in Eq.~\eqref{eq:Ham} were evaluated with the MOLCAS 8.0~\cite{Aquilante_JCC_2016} program package, applying the ANO-RCC basis set of triple-$\zeta$ quality.~\cite{Roos_JPCA_2004,Roos_JPCA_2005}

The electron-vibrational couplings in the SF basis, $g_{0n,\xi}$, were obtained from the forces at vertical excitation employing a quantum chemical hybrid approach on the basis of the shifted harmonic oscillators model.
Here, the force constant matrix was determined at the level of DFT/B3LYP/6-311G(d) for the ground state and the gradients in the excited electronic states were computed at the ground state geometry using the  RASSCF method as described above. The width $\gamma$ in the spectral density, Eq.~\eqref{eq:J}, accounting for the interaction between the modes of the solvated ion and further  degrees of freedom of the environment, was set to 500~cm$^{-1}$ for all normal modes. The  rates $\Gamma_a$, phenomenologically accounting for Auger decay, were set to 0.4 and 1.04\,eV for the L$_3$ and L$_2$ edges, respectively.~\cite{Ohno_JESRP_2009} These values correspond to lifetimes of the core hole of 10.3 and 3.98\,fs.

Equation~\eqref{eq:LvN} was solved using the Runge-Kutta-Fehlberg integrator with adaptive step size varying from 2.5\,as down to 0.09\,as depending on the field strength. The initial density matrix was populated according to the Boltzmann distribution at 300~K:
\begin{equation}\label{eq:rho0}
\rho_{ab}(0)=\delta_{ab} \exp (-E_a/kT)/\sum_c \exp (-E_c/kT) \, .
\end{equation}

The parameters $E_0$, $t_i$ and $\sigma$ in Eq.~\eqref{eq:pulse}, determining the shape of the time-dependent external electric field, were chosen to roughly resemble the regimes of the commonly used driving laser systems for the generation of high harmonics.
However, some  assumptions on the form of the incoming electric field have been done allowing to simplify the computational protocol.
For the wavelength of the driving laser, we have chosen 800\,nm corresponding to the Ti:Sapphire laser as well as  400,  1400, and 2000\,nm, which can be obtained by frequency doubling and parametric amplifiers of the 800\,nm laser.
These values correspond to shifts between consecutive sub-pulses $t_i-t_{i-1}$ from about 1 to 7\,fs, see Table~\ref{tab:pulse}. Ten pulses have been considered in each series assuming equal envelopes of the subpulses for simplicity.
The simulations have been carried out for two field amplitudes, $E_0$, of 2.5 and 0.25\,a.u. for each pulse comb.
Note that despite the large values of $E_0$, at soft X-ray wavelength this corresponds to the weak field regime, see Refs.~\citenum{Wang_PRL_2017, Wang_MP_2017}.
The polarization vector $\vec{e}$ has been chosen to be parallel to the
shortest Fe--O bond of the [Fe(H$_2$O)$_{6}$]$^{2+}$ complex.
It should be noted that the trains of ultrashort pulses in our theoretical study have been designed solely for illustration purposes and correspond to realistic experimental setups only approximately.
However to the best of our knowledge, such a setup is not yet available.
The real carrier frequencies used have not been set to particular harmonics of the driving laser and for convenience corresponded to maxima of two peaks in absorption spectrum (708.4 and 711.5\,eV, cf. Fig.~\ref{fig:multi_pulse_scheme}b)), considered before, see Refs.~\citenum{Wang_PRL_2017,Wang_MP_2017}. Fig.~\ref{fig:multi_pulse_scheme}b) also contains the HHG frequency combs generated with different lasers overlaid with the spectrum.
One can see that the chosen ``resonant'' carrier frequencies only slightly differ from the exact positions of the harmonics apart from the case of 400\,nm driving laser.
The widths $\sigma$ in Eq.~\eqref{eq:pulse} have been chosen as $T/14$ and $T/28$, where $T$ is the period of optical cycle of the driving laser.
Here we assume that the parameter $\sigma$ can be controlled filtering out the low-energy harmonics of the HHG output.
(Otherwise, it would be bound to the inverse of the cutoff energy.)
The pulse characteristics are summarized in Table~\ref{tab:pulse}.
\section{Results and discussion}
\label{sec:results}

\iffalse
The process of ultrafast spin-flip dynamics discussed here and in Refs.~\citenum{Wang_PRL_2017,Wang_MP_2017} can be conveniently understood for the example of the isolated Fe$^{2+}$ ion possessing the full spherical symmetry.
In this case, the electronic states can be classified according to the angular, spin, and total momentum.
The preparation conditions of \textit{Case I} in Ref.~\citenum{Wang_PRL_2017}, correspond to the instantaneous excitation of complex superposition of SOC eigenstates resulting in population of a single specific $D_4$ spin-free state with angular momentum projection \rt{$L_z=+2$ spin projection $M_S=+2$}.
Note that the spin-flip dynamics is common for core-excited states and this very state has been chosen for illustration purposes.
Fig.~\ref{} demonstrates the population dynamics of states having different angular and spin momenta.
The core-excited Fe$^{2+}$ ion has a 2p$^5$d$^7$ electronic configuration leading to a manifold of states with different angular momenta for both high- (quintet) and low-spin (triplet) cases.
One can see that the ultrafast transition from the quintet to triplet manifold is connected to the ultrafast change in angular momentum thus leaving the total momentum unchanged.
General trends:
\begin{itemize}
 \item stepwise pumping of triplet population
 \item after few first pulses it reaches saturation
 \item differences between 710 and 713 are not that pronounced as it was for the single pulse case (probably connected to broader pulses)
 \item bath has no influence and the effect is fully covered by Auger decay.
\end{itemize}

\fi

\subsection{Role of electron-vibrational coupling}
\label{sec:bath}
\begin{figure*}
\includegraphics[width=0.95\textwidth]{energy_mode15.pdf}
\caption{The cuts of the potential energy surfaces along the most active tuning vibrational mode  (ground state frequency 417\,cm$^{-1}$). Panels a) and c): core and valence PESs of quintet SF states (red lines) and triplet SF states (blue lines), respectively, in the SF basis. Panels b) and d): same PESs in SOC basis, the color of lines corresponds to the collective contribution $\sum_{n,M_S} |C^{(S=2,M_S)}_{an}|^2$ of all quintet ($S=2$) SF states to a particular $\ket{\Psi^{\rm SOC}_{a}}$, see Eq.~\eqref{eq:SOC_states}. Note that only a part of states is shown in panels a) and b), corresponding mainly to the L$_3$ absorption band. Also note that due to the hybrid approach (DFT ground state geometry and RASSCF PES) the minima of the ground state PES is not at zero.
\label{fig:PESs}
}
\end{figure*}

\begin{figure}
\includegraphics[width=0.5\textwidth]{matrix_HR.pdf}
\caption{Huang-Rhys factors, $g_{0n,\xi}^2/2$, for the transitions from the ground to the quintet (Q) and triplet (T) SF states for all 51 vibrational modes $\xi$.  Inset: Distribution of relaxation rate  $\hbar k_{a \rightarrow b}$ values (Eq.~\eqref{eq:k_ab}) for different pairs ($a,b$) of valence and core SOC states.  (Note that the first column of the histogram is cut at the value of 10.)
\label{fig:HR_matrix}
}
\end{figure}

In order to obtain an overview with respect to the effect of electron-vibrational coupling, we have calculated one-dimensional cuts of the potential energy surfaces (PES) along the symmetric Fe--O breathing mode ($\xi=15$), which is the  most strongly coupled mode (see below). Results are shown in Fig.~\ref{fig:PESs}, with the color code  indicating the change of multiplicity of the respective states from quintet (red) to triplet (blue). Panels a) and c) correspond to PES of core- and valence-excited electronic states, respectively, in the SF basis. The results for the SOC state representation are shown in panels b) and d).

\begin{figure*}
\includegraphics{selected_maxkab.pdf}
\caption{Population of selected states corresponding to the largest relaxation rates (cf.~Fig.~\ref{fig:HR_matrix}) with (dash lines) and without  (solid lines) bath. a) core SF states; b) valence SF states; c) core SOC states; d) valence SOC states. The envelope of the excitation pulse is shown as a grey-shaded area.
\label{fig:pop_selected}
}
\end{figure*}

The states at lower energy are of quintet character in all cases.
For the valence excited states this is followed by a band of triplet states, with some occasional mixing between triplet and quintet states in the SOC basis in the vicinity of intersection points.
We also notice that triplet states cross each other.
Since the selected mode is of tuning-type it can be anticipated that there are coupling modes, which render these crossings into conical intersections.
Overall, the treatment of the dynamics in the valence excited states would require sophisticated wave packet propagation.

The situation is rather different  for the core-excited states, in particular, concerning the SOC state PES, which are of main interest here.
Due to the large value of the SOC ($|V_{\rm SOC}|=8.5$\,eV) there are substantial energy shifts if panels a) and b) are compared.
In addition, there is a splitting of the $M_S$-components, leading to an almost continuous density of states (especially in energy region 708-711\,eV which will be used for excitation below).
In passing, we notice that in panel c) one can still observe a certain pattern with respect to the multiplicity of the states, which changes from quintet via strongly mixed to triplet with increasing energy.

From this picture one can draw two conclusions:
First, SOC is the dominant coupling mechanism, making electron-vibrational coupling a small perturbation at short times.
This justifies the use of a Markovian Quantum Master Equation for the description of the effect of electron-vibrational coupling.
Second, due to the essentially continuous density of states it can be expected that  details of the electron-vibrational interaction will only be of minor importance.
Although the SF PES are manifestly anharmonic, the harmonic approximation in conjunction with the Huang-Rhys model might still give a reasonable estimate for the electron-vibrational coupling constants.    In fact, one might view the present approach as providing a simple kinetic approach to  the influence of electron-vibrational coupling on the spin-flip dynamics.

Analysis of Huang-Rhys factors in the SF basis, $g_{0n,\xi}^2/2$, shows that only few vibrational modes out of the 51 possible ones are active, see Fig.~\ref{fig:HR_matrix}. Most prominent shifts between harmonic oscillators for both quintet and triplet as well as valence- and core-excited states correspond to two modes ($\xi=10$ and  15) with  ground state frequencies of 228 and 417~cm$^{-1}$, which are of Fe--O stretching type. This is not surprising since only oxygen 2p orbitals are strongly mixing with 3d orbitals of iron and thus both 3d-3d and 2p-3d electronic transitions are influenced by the distance to oxygens and are almost insensitive to vibrations of water ligands themselves. Nevertheless, some other vibrations like symmetric O--H stretching modes at 3640~cm$^{-1}$ ($\xi=43$) and 3645~cm$^{-1}$ ($\xi=45$) also have non-vanishing magnitudes, but do not play a major role.

The rates calculated according to Eq.~\eqref{eq:k_ab} are summarized in a histogram shown as an inset in Fig.~\ref{fig:HR_matrix}.
Out of 288420 possible state pairs and thus transition rates, only few are larger than 0.01\,eV.
Remarkably, energy dissipation due to transitions between valence states is more prominent than that between core excited states.

The population dynamics for the selected valence and core SF and SOC states is presented in Fig.~\ref{fig:pop_selected}.
These states have been selected to show the effect of the largest  dissipation rates.
To simplify the analysis, the regime of excitation corresponds to the single 132\,as pulse, resembling that used in Ref.~\citenum{Wang_PRL_2017}, and neglecting Auger decay.
Due to the spectral bandwidth of ultrashort pulse many core states are excited.
The typical populations of individual states are comparable to that shown in Fig.~\ref{fig:pop_selected}a.
The populations of valence SF states show oscillations typical  for zero-order states building up a superposition in case of small coupling between them.
The core SF states in turn exhibit a more intricate pattern which can be explained by much stronger coupling and larger state density.
The eigenstates of the SOC Hamiltonian are stationary as soon as the pulse is over and no dissipation is accounted for.
Interaction with the vibrational bath causes notable population transfer between state pairs with largest $k_{a \rightarrow b}$.
However, due to the small amount of such pairs with $\hbar k_{a \rightarrow b} > 0.01$\,eV which are essentially responsible for energy dissipation to the vibrational bath, such a relaxation does not play decisive role at least at the timescale of 15\,fs which is very small if compared to typical period of Fe--O stretching vibrations ($>100$\,fs).
Although the populations of the particular states with the largest $k_{a \rightarrow b}$ are notably affected by the dissipation as is illustrated in Fig.~\ref{fig:pop_selected},
the populations of these states themselves are quite small what does not lead to notable differences in the dynamics of the total populations of quintet
and triplet
states (compare magnitudes of populations with Fig.~\ref{fig:dynamics1}a).

Summarizing, within our model the SOC driving force (which is electronic in its nature) of the ultrafast spin flip is by far dominating over the effect of electron-vibrational coupling.  Essentially, the population relaxation due to vibrations can be neglected especially taking into account the ultrashort time period considered. Importantly, the dephasing caused by coupling to the nuclear bath is not destroying the coherence initially created by the absorption of the ultrashort pulse. The last statement, however, requires a note of caution. In our study, we did not account for the width of nuclear wave packet in the initial state which can also cause ultrafast dephasing.~\cite{Vacher_PRA_2015,Arnold_PRA_2017,Vacher_PRL_2017

\subsection{Multipulse excitation}
\label{sec:mult_pulse}
\begin{figure*}
\includegraphics[width=0.9\textwidth]{dynamics1.pdf}
\caption{Spin dynamics initiated by pulse trains
having different characteristics: The shape of the normalized pulse envelope $\tilde{E}(t)/E_0=\sum_i\exp(-(t-t_i)^2/(2\sigma^2))$ is depicted with grey filled curves. The  populations of electronic SF states are presented for the cases of total quintet, Q(tot), and triplet, T(tot), as well as of the respective valence, Q(val) and T(val), and core, Q(core) and T(core). The black curve corresponds to the population of the lowest quintet (ground) state; note the finite temperature of 300\,K resulting in an initial population of 0.92. The amplitude $E_0$, wavelength of the driving laser $\lambda$, carrier frequency (energy) $\hbar \Omega$, and subpulse duration $\sigma$ are given in the respective panels.
The dissipation due to vibrational bath is included.
Panel a): Dynamics initiated by a single pulse ($E_0=$2.5\,a.u., $\hbar \Omega=708.4$\,eV, $\sigma=$132\,as), no vibrational bath, no Auger decay. Panel b): Example of dynamics accounting for Auger decay. Panels: c)-f) Auger decay is excluded for  simplicity of the analysis.
\label{fig:dynamics1}
}
\end{figure*}

\begin{figure*}
\includegraphics[width=0.9\textwidth]{dynamics2.pdf}
\caption{Spin dynamics initiated by pulse trains
having different characteristics as given in the panels; see also Fig.~\ref{fig:dynamics1}.
\label{fig:dynamics2}
}
\end{figure*}

\begin{figure}
\includegraphics[width=0.47\textwidth]{integrated_intensity.pdf}
\caption{
Relative yield of the total triplet population, T(tot), with respect to the total quintet one, Q(tot), versus the integrated intensity envelope $I_i=\int_{-\infty}^{(t_{i+1}-t_i)/2} |\tilde{E}(t)|^2 dt$. Here, the time $(t_{i+1}-t_i)/2$ corresponds to end of the $i$th subpulse in a train before $i+1$th  subpulse starts. Panels a) and b) correspond to  $\lambda=800$ and 2000\,nm. The population dynamics with/without Auger decay are shown as solid/dashed lines, respectively.
\bt{
For $E_0=2.5$\,a.u. in panels a) and b), the first subpulse in the sequence is split into parts to ensure the overlap of two groups of curves along the $I_i$-axis, see text.} The respective data are shown with filled circles. In panel c), the results for different $\lambda$ are presented for $\sigma=T/14$. Two horizontal lines denote the starting T(tot)/Q(tot) and the point of T(tot)=Q(tot).
\label{fig:integrated_intensity}
}
\end{figure}

It has been shown previously that a single intense soft X-ray pulse can cause an unprecedented ultrafast spin-flip.~\cite{Wang_PRL_2017, Wang_MP_2017}
An illustration for this process is given in Fig.~\ref{fig:dynamics1}a.
Here, the total populations (Q(tot) and T(tot)) of quintet, $\sum_{n} \rho_{nn}^{(S=2)}$, and triplet, $\sum_{n} \rho_{nn}^{(S=1)}$,  SF states are shown as a function of time.
In addition, the overall populations of valence and core quintet and triplet states are given, where summation over $n$ is performed only within the respective manifolds.
One can see that an isolated pulse with duration 132\,as initially excites the system to the quintet core manifold and subsequently the population transfers to the triplet manifold on the timescale of few fs due to strong SOC. This process is purely electronically driven and occurs even  when the nuclei are fixed and no coupling to the vibrational bath  is accounted for.~\cite{Wang_PRL_2017, Wang_MP_2017}

Since isolated few-femtosecond and sub-femtosecond pulses
require special techniques to be obtained,~\cite{Schultz_book_2014} we have investigated what happens if pulse trains are applied. The parameter space $(\lambda, \sigma, E_0, \hbar \Omega)$ of these pulse bursts (see Section~\ref{sec:comp}) has been systematically screened.
In the following, we discuss the main trends on the basis of few illustrative examples shown in Figs.~\ref{fig:dynamics1}b)-f) and~\ref{fig:dynamics2}; more  results can be found in the Supplement.
Both
figures focus on two driving laser wavelengths, i.e.\ 800\,nm and 2000\,nm.
The first one corresponds to the most common Ti:saphire laser, typically used for HHG experiments, whereas the second is available via parametric amplifiers and should allow for
higher cutoff energies possibly reaching soft X-ray range with higher intensity.
Note  that $\lambda$ actually fixes the interpulse delay to the half of period.
Moreover, in our model, the duration of individual subpulses has been chosen to depend on the period ($\sigma=T/14$ and $T/28$) and thus $\lambda$ itself, see Sec.~\ref{sec:comp}.
This makes the wavelength of the driving laser the most important parameter in our simplified model.
Further, to address the field strength dependence, the results are presented for $E_0=2.5$\,a.u. and 0.25\,a.u. with respective intensities 8.8$\times$10$^{16}$ and 8.8$\times$10$^{15}$ W/cm$^2$.
The carrier frequencies of $\hbar\Omega=$708.4 (Fig.~\ref{fig:dynamics1}) and 711.5\,eV (Fig.~\ref{fig:dynamics2}) correspond to the maxima of two peaks in L$_3$-edge absorption spectrum of aqueous Fe$^{2+}$ ion, see Fig.~\ref{fig:multi_pulse_scheme}b).~\cite{Golnak_SR_2016}
These regions resemble  different spin-orbit coupling regimes, see for instance Ref.~\citenum{Wang_PRL_2017}. At 708.4\,eV the prepared superposition of states contains more quintet SF states, whereas at 711.5\,eV more triplet ones as is apparent from Fig.~\ref{fig:PESs}b).

Looking at the results in Figs.~\ref{fig:dynamics1}c)-f) and~\ref{fig:dynamics2} one can see that the pulse trains essentially demonstrate similar effects on the spin dynamics of the system as the isolated pulses (cf.
Fig.~\ref{fig:dynamics1}a), but with a number of differences.
First, there are prominent ultrafast dynamics happening between individual pulses in a train.
It is most obvious in case of high field intensities.
These dynamics corresponds to the field-free evolution of the coherent electronic wave packet created by a single pulse. As a result the population of SF quintet states drops down and that of SF triplet states increases between pulses.
Note the close similarity between the initial region of the population curves, e.g., in panels a) and c) of Fig.~\ref{fig:dynamics1}.

Second, a remarkable feature of the dynamics is the stepwise pumping of the triplet population with each new incoming subpulse if $E_0=$2.5\,a.u. is used.
In general, the height of the steps is almost monotonously decreasing with every next pulse and the population approaches a plateau, which only slightly depends on the pulse characteristics and in most cases amounts to around 0.7.
For instance, for $\lambda=$800~nm and 2000~nm and $E_0=$2.5\,a.u.
the first five or six pulses correspond to largest steps in triplet population growth and subsequent ones lead to relatively minor changes in population, comparable to those of free dynamics (panel~\ref{fig:dynamics1}a)).
Thus, every next subpulse increases the triplet yield, if only final populations are in focus.
Observing the stepwise behavior in experiment would, however, require a pump-probe setup, what makes such an observation challenging.

In some cases, valence excited states gain substantial population.
For instance, valence triplet states constitute up to 35\% of the total triplet population.
This effect may be clearly seen in the changes of populations during pulses with $E_0=$2.5\,a.u., where both triplet and quintet valence populations may rise during the pulse, and may be attributed to stimulated emission. However, this effect may be considered as being of limited practical relevance, since it requires very high field strengths.

The character of the dynamics changes quite notably when the strength of the pulses is decreased by a factor of ten (Fig.~\ref{fig:dynamics1}d) and f) as well as Fig.~\ref{fig:dynamics2}b) and d)).  In this case, the contribution from stimulated emission is barely seen, apart from panel~\ref{fig:dynamics1}f).
The behavior of the system shows a much more regular stepwise pumping with the sizes of the steps being almost constant and much smaller than for the stronger fields.
The yield of triplet states in most cases stays below that of quintet states, with the examples shown in panels \ref{fig:dynamics1}b) and \ref{fig:dynamics1}d) being rather an exception (see, e.g., Fig.~\ref{fig:integrated_intensity}).
The qualitative behavior of quintet and triplet populations with respect to each other is not changed when Auger decay is included apart from the double-exponential total decay (see Fig.~\ref{fig:dynamics1}b as well as Supplement).

One can also analyze the dynamics in terms of the integral intensity (energy) transferred from the pulse to the system.
For this purpose, we have plotted in Fig.~\ref{fig:integrated_intensity} the total triplet yield relative to the total quintet population, T(tot)/Q(tot), versus the integrated intensity envelope $I_i=\int_{-\infty}^{(t_{i+1}-t_i)/2} |\tilde{E}(t)|^2 dt$.
Here, $i$ runs over individual pulses in a train and, thus, the triplet yield after every subpulse is plotted.
\bt{The data represent two groups of curves for $E_0=0.25$ and 2.5\,a.u. which are barely overlapping along the intensity axis if integer number of pulses is considered.
To compare the triplet yield for both $E_0$ at the same value of integrated intensity,
we have split the first pulse in the sequences with $E_0=2.5$\,a.u. into pieces of shorter duration (and thus smaller intensity).}
The respective data points are depicted by the filled circles in Fig.~\ref{fig:integrated_intensity}a) and b).
The data with Auger decay taken into account are plotted as dashed lines; these data sets included always 10 pulses in a train.
For dynamics without Auger effect and 0.25\,a.u. field amplitude, longer pulse sequences are applied again to increase \bt{the overlap in integrated intensity} with stronger pulses.
Further, results for different $\lambda$ and $\hbar \Omega$ are given in panel c) for $\sigma=T/14$.

The dependencies in Fig.~\ref{fig:integrated_intensity} can be roughly subdivided into several almost linear regions (see Fig.~\ref{fig:integrated_intensity}b); note the double logarithmic scale): i) initial one, mainly seen during the first pulse for $E_0=2.5$\,a.u.; ii) linear rise with high steepness most apparent for $E_0=0.25$\,a.u; iii) rise with lower steepness; iv) saturation region which can be followed by decrease or oscillatory behavior of the T/Q ratio.
The region iii) with lower steepness begins when the triplet population starts to dominate the quintet one.
That is why it can be attributed to the interplay of the absorption/emission and Q$\rightarrow$T/T$\rightarrow$Q forward and backward processes, thus, decreasing the rate of the spin crossover.
Remarkably, the steepness of the linear regions i)-iii) is quite similar for different pulse characteristics, see, e.g., Fig.~\ref{fig:integrated_intensity}c).
Similarity of all dependencies underlines the statement that the essential dynamics does not crucially depend on the pulse strength what justifies selection of high intensities for illustration purposes.

Pulse duration or associated bandwidth has also an influence on the dynamics.
In general, shorter durations ($\sigma=T/28$) cause faster oscillations than the longer ones ($\sigma=T/14$), compare \ref{fig:dynamics2}a) and \ref{fig:dynamics2}c) with \ref{fig:dynamics2}e) and \ref{fig:dynamics2}f).
This can be rationalized by the larger bandwidth and thus involvement of more energetically distant states in the superposition.
Naturally, since $E_0$ is the same for both durations, shorter pulses have smaller area under the $|\tilde{E}(t)|^2$ curve and thus are effectively weaker than the longer ones (note the shift along $x$-axis in Fig.~\ref{fig:integrated_intensity}).

Interestingly, pulse-train excitation with weaker fields shows more variability than with stronger ones.
This applies both to time-dependences of populations (Figs.~\ref{fig:dynamics1} and~\ref{fig:dynamics2}) and integral intensity picture (Fig.~\ref{fig:integrated_intensity}).
For weaker pulses, the system is not kicked that hardly and evolution is closer to its natural dynamics. This is not the case if trains of pulses with $E_0$=2.5\,a.u. are used. Here, populations of all kinds of states show a similar pattern across the pulse parameter space.
Importantly, at both carrier frequencies triplet population exceeds the quintet one reaching a plateau at similar values.
In contrast, weaker pulses ($E_0=$0.25\,a.u.) initiate the dynamics that are much more similar to those triggered by a single pulse.~\cite{Wang_PRL_2017,Wang_MP_2017}
For instance, two carrier frequencies ($\hbar \Omega=$708.4 and 711.5\,eV) and pulse durations ($\sigma=T/14$ and $\sigma=T/28$) correspond to different yields of triplet states.
However in general, one can say that dynamics driven by a series of pulses seems to be less dependent on the characteristics of a particular pulse in a train than in case of isolated pulses.

A possible explanation could be that a single pulse creates a coherent superposition which evolves in time according to the full Hamiltonian in Eq.~\eqref{eq:Ham}, while multiple pulses constantly prepare new superpositions smearing out the populations over core- and valence-excited states in course of absorption and stimulated emission.
This smearing over states with different energies makes the overall dynamics having less dependence on the position of the center and bandwidth of the incoming field envelope in the frequency domain. It could also be the reason for the plateau-like behavior of the triplet populations in case of the stronger field.

Surprisingly, the delay between consecutive pulses has also quite moderate influence on the dynamics.
Only for
$\lambda=$400\,nm the pattern of the fast oscillations notably changes.
It corresponds to the shortest pulses used in this work meaning the largest bandwidth in the frequency domain.
The ultrafast oscillations with a period of 0.32\,fs can be then attributed to the superposition of the most distant states split due to SOC by 12.7\,eV.

Finally, the leak of the norm due to Auger process is very fast (Fig.~\ref{fig:dynamics1}b)), corresponding to biexponential decay with time constants 3.98 and 10.34\,fs in accordance with our phenomenological model (Eq.~\eqref{eq:Auger}).
Despite of this fast decay, the spin-flip process is still faster leading to a behavior similar to that discussed above.
The only difference is that in this case the total triplet population is lower and is decaying with the slow Auger component.
In this respect, depositing population into valence triplet manifold enabled by stimulated emission decreases the destructive effect of the Auger decay on the spin-flip efficiency.
This scenario, however, would require very intense fields which are not yet achievable in practice.

The same conclusions can be drawn from Fig.~\ref{fig:integrated_intensity}.
There, the Auger decay naturally shows up for longer times (larger number of subpulses) and that is larger integrated intensities.
At the beginning (region ii)) the population curves with and without Auger autoionization almost coincide and the divergence becomes more obvious for large intensities.
Interestingly, Auger decay has a major effect for sequences of weak pulse  ($E_0=0.25$\,a.u.), where it tends to notably decrease the triplet yield.
For stronger fields, the effect is smaller and, in contrast, the triplet yield increases.

Summarizing, weak pulses are more selective.
Further, for a particular integrated intensity without Auger decay, they are more efficient than the stronger ones if we compare triplet yields for a fixed $I_i$ (Fig.~\ref{fig:integrated_intensity}).
Accounting for the fact that they are more readily available in experiment, this makes them the most suiting candidates to address or steer ultrafast spin dynamics.
This effect is, however, counterbalanced by the destructive influence of Auger decay.
One the other hand, from the viewpoint of the time of the spin crossover, stronger pulses should be more efficient as they lead to faster increase of triplet population.
In this case, the Auger effect is less important because of faster spin-flip transitions and involvement of non-decaying valence states via stimulated emission.

\iffalse
\begin{figure*}
\includegraphics[width=0.95\textwidth]{./images/Fig_713_1400_VC.eps}
\caption{Another figure to include.
\label{fig:dynamics_713_1400}
}
\end{figure*}
\fi

\section{Conclusions}
\label{sec:concl}
This study represents an extension of the  analysis of  ultrafast spin-flip dynamics reported before.~\cite{Wang_PRL_2017, Wang_MP_2017}  The main two questions addressed here are: Does the coupling of the electronic subsystem to nuclear vibrations alter the dynamics? What changes if pulse trains are used instead of a single pulse?

The former problem is treated at the level of system--bath partitioning.  This approach corresponds to an approximate scheme since no non-adiabatic coupling is taken into account explicitly. Moreover, the width of nuclear distribution in the ground state is not accounted for. The bath is represented essentially by a single damped totally-symmetric vibrational mode which is strongly coupled to the  electronic states.  The effect of energy dissipation and decoherence is taken into account using a simple Bloch model. The computed rates are very small in comparison to the strength of SOC.  Moreover, the state pairs which are notably coupled by the symmetric stretching mode are very small in number.
Therefore, within our dissipative model, the vibrational bath does not play prominent role on dynamics at least at the considered time-scale below 50\,fs.

Further, the effect of the multi-pulse excitation typical for HHG setups has been simulated.  Parameters of the pulses have been chosen to roughly resemble possible experimental setups.
The net effect of interaction with pulse trains is in general analogous to isolated pulse excitation.
Most important is that ultrafast spin-flip also occurs for multiple pulses.
Even more, utilizing bursts makes the process more efficient leading to a stepwise pumping of triplet population.
Interestingly, the differences in dynamics caused by intense pulses show less sensitivity to individual pulse characteristics such as carrier frequency, duration, and interpulse delay.
Weaker pulses are more selective and in some cases show no predominant population of spin-flipped states.

The effect, studied here theoretically, calls for experimental observation.
Our study suggests that the light characteristics needed to trigger this effect are within reach.
We are confident that further development of non-linear X-ray spectroscopic techniques such as stimulated resonant inelastic X-ray scattering~\cite{Zhang_TCC_2015} or employment of magnetic circular dichroism probe within a pump-probe experiment will enable measuring ultrafast spin-flip dynamics.

Although it is of fundamental interest to address ultimate timescale of electron dynamics caused by spin-orbit coupling, we envisage  that this effect could  be used for clocking ultrafast events.
In this respect, it is of core-hole clock type~\cite{Piancastelli_JPB_2014} but has a different nature.
Moreover, in case of spin-flips the characteristic timescale may be varied by addressing different atoms in the system or various types of core holes as well varying the carrier frequency and bandwidth of the incoming radiation, thus adjusting the strength of the coupling and thereby determining essentially the measured time window.

\section*{Acknowledgments}
The authors would like to acknowledge the fruitful discussion with Prof. Dr. Stefan Lochbrunner (University of Rostock) as well as financial support from the following sources: Deanship of Scientific Research (DSR), King Abdulaziz University, Jeddah, grant No. D-003-435 (H.W. and O.K.), Landesgraduiertenf\"orderung of Mecklenburg-Vorpommern (T.M.), and Deutsche Forschungsgemeinschaft grant No. BO 4915/1-1 (S.I.B.).

redpajama_set_name: RedPajamaArXiv


The first outing with Inspiring Connections Outdoors in Northern New Mexico will take place on Friday, July 27, 2018, with YouthWorks of Santa Fe. This will be a day hike in the vicinity of Santa Fe. The exact location will be determined later, since currently many of the trails around Santa Fe are closed, but they may be open by late July. If you would like to volunteer to help give youth an opportunity to appreciate the outdoors, contact Raymond N. Greenwell at matrng@hofstra.edu or 516-312-5751. For more information about Inspiring Connections Outdoors, visit https://www.riograndesierraclub.org/ico/.